parameters

J

Jeremy

Guest
I am trying to learn Bash scripting. I can't get a handle on parameters... I want to determine if a string has been sent to my script. How would I start this?

Thanks for the help.
 


OP
G

GrumpyOldMan

Guest
The bash man page has a section on parameters that should explain everything for you. Pay especial attention to the section on "Special Parameters"
 
OP
B

bashcommando

Guest
If you are familiar to batch %1 is the same as $1 on bash
So if you run the command
Code:
./test.sh this is a test
The variables recorded would be:
Code:
$0=test.sh
$1=this
$2=is
$3=a
$4=test
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation


Top