Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How do I open the shell prompt?

1136


Why is a script important?

986


What does $@ mean in shell?

964


How will you find the 99th line of a file using only tail and head command?

2479


Why do we use shell scripting?

933


What are filters explain sort with all the options available?

1279


Explain about shebang?

988


State the advantages of shell scripting?

1009


When should shell programming/scripting not be used?

1078


Suppose you execute a command using exec, what will be the status of your current process in the shell?

1021


What is @echo off?

942


Given a file find the count of lines containing the word "abc".

1491


What is inside a seashell?

1070


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.

2204


What is a beat in a script?

981