How do you print the output the same string which is typed
in command line. how do you write the shell script or
command for this. if i entered "Hello" in command line, it
should print 'Hello', if i say "Hello Welcome", i should get
the "Hello Welcome" as output.?
Answer Posted / nirmala
1)If you type "hello" in command line your script should be
written as below
echo $1
2)If you type "hello world" in command line your script
should be written as below
echo $*
3)If you type "hello" and "hello world" in cmd line and
your file name is"string" script is as written below
echo $1
shift 1
echo $*
i/p: string hello hello world
o/p:hello
hello world
| Is This Answer Correct ? | 0 Yes | 6 No |
Post New Answer View All Answers
How to get the first line from a file using just the terminal?
What is the conditional statement in shell scripting?
What language is bash written in?
What are the two files of crontab command?
determine the output of the following command: echo ${new:-variable}
Explain how you Automate your application using Shell scripting.
Explain about non-login shell files?
What is wc in shell script?
What is the meaning of $1 in shell script?
What is shift command in shell script?
What is eval in shell script?
write a shell script to check the failed jobs?
Which scripting language is best for automation?
What is bash eval?
What is @echo off?