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
How do I open the shell prompt?
Why is a script important?
What does $@ mean in shell?
How will you find the 99th line of a file using only tail and head command?
Why do we use shell scripting?
What are filters explain sort with all the options available?
Explain about shebang?
State the advantages of shell scripting?
When should shell programming/scripting not be used?
Suppose you execute a command using exec, what will be the status of your current process in the shell?
What is @echo off?
Given a file find the count of lines containing the word "abc".
What is inside a seashell?
Hello all, This is my assignment on shell scripting, can anyone help me regarding this ? Create a shell script which connects to the database In second shell script include the first script for the DB connection Create a table (PRADEEP_DATA) with 2 columns (name, value) In Third shell script include the first script for the DB connection And insert/delete the values from the Table, by accepting input from the user This functionality should be a menu driven Program: 1) Insert to the database a. Name b. value 2)Delete from the database a.Name b.value Exception handling needs to be taken care.
What is a beat in a script?