Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Shell script: How can i get the parameters of a command line?

635105May 7 2012 — edited May 11 2012
Im a newbie. Help please!
For example my mini script test.sh
#!/bin/bash
echo all parameters: $*
and now i run some test:
$ ./test.sh aa bb cc
all parameters: aa bb cc
ok!


$ ./test.sh aa bb $cc
all parameters: aa bb
where is here $cc ?


$ ./test.sh aa $bb cc
all parameters: aa cc
where is $bb ?



My question: How can i become 'aa $bb cc'? But without using of \ or ' or " like this:
 ./test.sh aa \$bb cc
or 
 ./test.sh 'aa $bb cc'
Many thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 8 2012
Added on May 7 2012
12 comments
933 views