What IS it producing? Note you don't appear to be redirecting your output within this calling() function so your script might be doing it...or it might not.
1) "exec" or "execute" is a sqlplus command that wraps the "begin ... end" block around whatever follows it. So you cannot put a "begin ... end" block around "exec" itself.
2) If the input parameter is a string, then add the string delimiter to it, otherwise Oracle will consider it an identifier.
3) Of course, just because the input parameter is declared a VARCHAR2 in the procedure signature doesn't mean that you cannot pass a number/integer etc. Oracle does an implicit conversion of the passed value to VARCHAR2 in that case.
4) If the input parameter is a string that has multiple words separated by whitespace, then enclose it within double-quotes in the shell script, at the function call, that is.
It would be great if you could tell us what it was actually doing wrong instead of just saying it's not working. When I try your code(modified slightly to just print the query) it seems to work fine:
#!/bin/bash
file_cnt=31337
cat << EOF
select count(1) into :t_cnt from $2;
insert into t_table(f_name, t_name, f_cnt,loaded) values
('$1','$2',$file_cnt,:t_cnt);
commit;
exit;
EOF
$ ./sqlplus.sh a b
select count(1) into :t_cnt from b;
insert into t_table(f_name, t_name, f_cnt,loaded) values
('a','b',31337,:t_cnt);
commit;
exit;
Is the highlighted portion what the actual query should be? If not, what do you want the query to be?