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 the command to calculate the size of a folder?
What is ps command in linux?
How do I run a shell script?
In order to display the last five commands you have entered using the fc command, you would type?
Why we use pwd command in linux?
What does uname do in linux?
what is the roles and responsibilities in linux system admin having 2yrs exp..?
What is command to check ports running/used over local machine
What command should you use to check your file system?
How to activate / deploy licence in RHEL 6 and what will happen if you don't activate / deploy licence in RHEL 6 ?
Which of the Commands delete the files from the /tmp directory, issued by non-root user?
can any one send me one project on linux ...?
Which commands are used to set a processor-intensive job to use less cpu time?
List the three main parts of an operating system command?
How to hide the partition in grub booting?