Question
In linux, in bash scripting, how do you print out the first command line argument given when script is run (e.g. if you run "./test.sh hello", "hello" would be printed)
echo $1 ^^^ the$1, prints our the first command line argument, $2 the second,$3 the third, etc

Question
In linux, in bash scripting, how do you print out the first command line argument given when script is run (e.g. if you run "./test.sh hello", "hello" would be printed)
?

Question
In linux, in bash scripting, how do you print out the first command line argument given when script is run (e.g. if you run "./test.sh hello", "hello" would be printed)
echo $1 ^^^ the$1, prints our the first command line argument, $2 the second,$3 the third, etc
If you want to change selection, open document below and click on "Move attachment"

7. Shell Scripting
Now create a file important_data with anything in it and then run ./backup-lots.sh important_data , which will copy the file 10 times with 10 different extensions. As you can see, the variable <span>$1 has a special meaning--it is the first argument on the command-line. Now let's get a little bit more sophisticated ( -e test whether the file exists): 5 10 #!/bin/sh if test "$1" = "" ;

#### Summary

status measured difficulty not learned 37% [default] 0

No repetitions