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
What is cpu core in linux?
Brief about the command nn?
What is linux load average?
What does uname do in linux?
What is tty in linux command?
Why we use pwd command in linux?
What is shell scripting commands?
What is the export command used for?
What is the copy command in linux?
Which command is used to uncompress gzip files?
What is dos and its commands?
What does rmdir do in linux?
What is bc command in unix?
Brief about finger username?
What are the examples of simple command?