So, I need to write a shell script that accepts a file path as an argument and uses it within the shell script. I know that I could do something like:
$ ./script filename
With this solution, this would make it so that I could access this filename string using $1 in the shell script.
However, I'm wondering if it is possible to use input redirection instead so I could pass the filename using it:
$ ./script < filename
If so, how would I access this filename in the shell script?
I'm fairly new to shell script coding so I'm not sure if this is even possible.