Guddi Yadav
asked on
Shell script - File name as a parameter
Hi,
How do I pass file name as a parameter in shell script ?
Thanks
How do I pass file name as a parameter in shell script ?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I think i mentioned that one of your paths looked wrong in a previous question. Maybe that's the problem. afaicr it began /Downloads
Inside the script you can refer to it. as the variable $1 (first parameter).
THIS is what i was referring to above
As Yujin said:
and in your script use:
./my_shell_script FILE_NAME_HERE
and in your script use:
FILE=$1
cat $FILE