How do you read arguments in a shell program - $1, $2 ..?

Answer Posted / madhavi

to read command line argments we hav to use echo $1
$2........whre $0-gives name of program,$#-gives number of
arguments passed and $* gives all the arguments.

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is echo $shell?

628


What is sudo command?

555


What does $$ mean in shell script?

593


What are the advantages of shell scripting?

590


What is a program shell?

572






What is the conditional statement in shell scripting?

661


In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?

642


What is inside a seashell?

649


What is bourne shell scripting?

537


What is the first line of a shell script called?

578


What is computer cli?

499


What does path stand for?

642


What does debug script mean?

555


How can you find out how long the system has been running?

530


Write the syntax for "if" conditionals in linux?

601