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
What does $@ mean in shell?
What is the first line in every perl script called?
What is the syntax of while loop in shell scripting?
What is the use of .sh file?
How will you pass and access arguments to a script in linux?
What is gui scripting?
How to calculate the number of passed arguments?
How to print pid of the current shell?
write a shell script to emulate the Id command of PRIMOS which lists files and directories. It list files first with a header FILES and then directories with a header DIRECTORIES. This command has several options. The main ones are. -file select files only -dir select directories only -reverse sort in reverse order -no_header put no header on the output -brief output the header only -size display the size of each file -help display Id´s syntax and options.
Print the 10th line without using tail and head command.
How to debug the problems encountered in the shell script/program?
Explain about "s" permission bit in a file?
Explain about sourcing commands?
What is sh in shell script?
How can you get the value of pi till a 100 decimal places?