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 is the command to calculate the size of a folder?

980


What is ps command in linux?

956


How do I run a shell script?

920


In order to display the last five commands you have entered using the fc command, you would type?

898


Why we use pwd command in linux?

1007


What does uname do in linux?

1031


what is the roles and responsibilities in linux system admin having 2yrs exp..?

4141


What is command to check ports running/used over local machine

1065


What command should you use to check your file system?

949


How to activate / deploy licence in RHEL 6 and what will happen if you don't activate / deploy licence in RHEL 6 ?

2637


Which of the Commands delete the files from the /tmp directory, issued by non-root user?

1031


can any one send me one project on linux ...?

2729


Which commands are used to set a processor-intensive job to use less cpu time?

988


List the three main parts of an operating system command?

876


How to hide the partition in grub booting?

1009