I think you have two scripts called test.sh . One is in the current working directory (./test.sh) and the other one is somewhere which can be found though $PATH (sh test.sh).
To find the duff one:
whence test.sh
# Or if your Shell doesn't have the "whence" command:
type test.sh
Interestingly if your current directory is not in $PATH the "sh test.sh" won't find the test.sh in your current directory.
On any system I've come across you would only definitely execute a script in the current directory with "sh scriptname" or just "scriptname" if you had a "." at the start of $PATH.
We routinely remove the "." from $PATH because it is a security risk.
Have you come across a unix where "sh scriptname" works for the current directory when there is no "." in $PATH ?
Yes, I have never had a dot in $PATH for the reason you stated and I think "sh scriptname" always worked if scriptname was in the current directory (perhaps similar to any command that uses a file, where you also don't need to specify the path), as long as it is readable (even though I habitually execute with "sh ./scriptname").
Just "scriptname" is a different matter, that only works without a path if it is in $PATH and if it is both readable and executable (aliases aside).
As you said there was one more script ... with same name in other directory..
as . is not in the path sh test.sh is executing that script... thanks i missed the simple concept .. thank you very much...
And i have one more doubt.. is there any limit on the number of positional parameters tat we can set using "set" command
The number of positional parameters which you can set depends on the Shell. In the original Bourne Shell it was 9 ($1-$9). I don't know of a low limit for any modern Bourne-type Shell (ksh, bash, Posix sh).
We'd need to know what Operating System you have in order to know what /usr/bin/sh means on your computer. Nowadays it's usually points to the Posix Shell in unix and to bash in Linux. However in say SUNOS it's the old Bourne Shell.