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 |
How to open a read-only file in the shell?
wats the deinitions for shell utility and filter?
Is powershell a bash?
Write a shell script to get current date, time, user name and current working directory.
Create a bash shell script to sort and then uniq the file from the command line & store it to a new file and output the results to the screen. Name this script "sortAndUniq.sh"
Is it possible to substitute "ls" command in the place of "echo" command?
What is the use of "$?" Sign in shell script?
How to find duplicate record in file using shell script?
0 Answers IBM, Saama Tech, Wipro,
what is this line in the shell script do ?#!/bin/ksh
write a shell script that accepts name from user and creates a directory by the path name, then creates a text file in that directory and stores in it, the data accepted from user till STOP, displays the no. of characters stored in the file.Program stops if directory name is null
Explain about login shell?
what do u mean by $#,$* in unix programming?