Create a bash shell script that reads a line from the user
consisting of 5 words and then prints them out in reverse
order. Name this script "reverse.sh"
Answer / priyanka joshi
read line;
echo $line | awk '{ for ( i = NF; i > 0; i--) print $i}' |
tr "\n" " "
Is This Answer Correct ? | 5 Yes | 5 No |
How will you list only the empty lines in a file (using grep)?
What lives in a shell?
In shell scripting if text is surrounded by single quotes what does it denotes?
how will you find the total disk space used by a specific user?
write a shell script to emulate the Id command of PRIMOS which lists files and directories. It list files first with a header FILES and then directories with a header DIRECTORIES. This command has several options. The main ones are. -file select files only -dir select directories only -reverse sort in reverse order -no_header put no header on the output -brief output the header only -size display the size of each file -help display Id´s syntax and options.
Where cron file kept?
Hi All, Is it possible to create one file name only space or space in file name in UNIX and we can able to run that on Unix?
What is a shell script? Can you name some of its advantages?
What is awk in shell script?
How many prompts are available in a UNIX system?
What is basename in shell script?
Explain about shebang?