How do you read arguments in a shell program - $1, $2 ..?
Answer Posted / seshadri sethi
Shell script accepts parameters in following format…
$1 would be the first command line argument, $2 the second,
and so on
$0 is the name of the script or function
If your script has more than 9 params then accept in
following way…
${12} : 12th param
${18} : 18th param
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Which is better perl or shell scripting?
What is the command to find out users on the system?
What are types of shells?
What are scripts in psychology?
How can the contents of a file inside jar be read without extracting in a shell script?
What does $@ mean in shell?
What is $1 in shell scripting?
What is awk in shell scripting?
Is bash an operating system?
Write a command sequence to find the count of each word?
What is a shell in operating system?
What does .sh file contain?
What is shell company all about?
Is powershell a language?
What is the use of echo in shell script?