I have a shell script that takes one variable as an argument, the way I execute it now is by typing bash script.sh arg1, is it possible to trigger it by just typing script arg1? thanks!
I have a shell script that takes one variable as an argument, the way
Share
You need to start your script with line:
and make its file executable:
chmod +x script.sh. Then you could run it by typing./script.shor even by justscript.shif it is located in one of the paths from your PATH environment variable.Note that the filename does not matter. It could be
script.sh,scriptor whatever you want.