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...

what is the command To print script arguments

Answer Posted / shabab

$* and $@ are the right answers

$# - prints out the number of arguments passed

Consider the below code
########################
for i in "$*"
do
print $i
done

for i in "$@"
do
print $i
done
########################

and you call the script by saying

#samp.sh hai welcome to "Unix Forum"
hai welcome to Unix Forum
hai
welcome
to
Unix Forum


The first line is the output by printing out $*
the next four lines are with the help of $@.

So
$* will combine all arguments to a single string
$@ will have each arguments as a seperate string

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does umask 077 mean?

990


How much ram do I have linux?

974


Which command is used to delete a group?

1186


How do you create a text file in linux?

1138


How do I check my cpu cores?

1011


What is cat command in linux?

1013


What is top command in linux?

992


What is a makefile in linux?

997


What commands are used to see all jobs running in the hadoop cluster and kill a job in linux?

963


What is linux pwd (print working directory) command?

972


How can I type in cmd?

930


How do you insert comments in the command line prompt?

1181


How to recover /etc/passwd file and /etc/shadow file?

990


What is umask 000?

945


What is the fastest way to enter a series of commands from the command-line?

1067