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 |
What is the default shell of solaris?
What is path in shell script?
HOW TO CREATE 10 USERS IN UNIX(HP-UX) USING SHELL SHELL SCRIPT?
What are the advantages of using shell scripts?
write a shell script to check whether all the directories in the path exist has read and write permission
What is the difference between running a script as ./scriptname.sh and sh scriptname.sh
I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?
I want to read all input to the command from file1 direct all output to file2 and error to file 3, how can I achieve this?
what are special characters and explain how does text varies by the usage of single quotes,double quotes and back quotes?
In a file , how to retrieve the lines which are the multiples of 50 ? like 50,100,150th lines etc.
What is shell variable?
How do I read a .sh file?