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.?
Answers were Sorted based on User's Feedback
Answer / santana20142003
$read line ---> it will read
$ echo $line ---> it will display
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / 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 |
c program the catches the ctrl-c(SIGINT) Signal for the first time and prints a output rather and exit on pressing Ctrl-C again
How to check if the previous command was run successfully?
How can any user find out all information about a specific user like his default shell, real-life name, default directory, when and how long he has been using the system?
What are the four fundamental components of every file system on linux?
What does $0 mean in shell script?
What is sed in shell script?
Explain about non-login shell files?
When you login to a c shell, which script would be run first?
How do I open a jshell in cmd?
I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?
whta is the use of "exec" command?
How do you create a shortcut in linux?