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
How use linux command line?
How do I find my user id in linux?
What is the use of man command in linux?
What is the command can be used to check for file corruption?
How do you insert comments in the command line prompt?
What does ls mean in linux?
Which command is used to uncompress gzip files?
How do you limit memory usage for commands?
Is cmake only for c++?
What are linux commands useful?
You are required to restore the file memo.ben. It was backed up in the tar file MyBackup.tar. Which command would you use to do it?
You wish to print the file vacations with 60 lines to a page. Which of the following commands will accomplish this?
What is devops linux?
Which commands are used to set a processor-intensive job to use less cpu time?
How do you open a command prompt when issuing a command?