The positional parameters are in $1 $2 $3 etc but if you are invoking the script with redirection, there is no positional parameter, and no file name, just standard input.
Code:
vnix$ ./myscript file.txt oops # inside myscript, $1 is "file.txt" and $2 is "oops"
vnix$ ./myscript # inside myscript, no file name is known; input is from standard input (terminal)
vnix$ ./myscript <file.txt # again, inside myscript, no file name is known; input is redirected to come from file.txt