If you have a string "one two three", which shell command
would you use to extract the strings?

Answer Posted / asit pal

echo $a | tr " " "\n" | head -1
echo $a | tr " " "\n" | head -2
echo $a | tr " " "\n" | head -3

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the syntax of "nested if statement" in shell scripting?

631


What are the advantages of shell scripting?

584


What are zombie processes?

569


What is the use of a shebang line?

620


How can I set the default rwx permission to all users on every file which is created in the current shell?

906






I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?

754


What is in a script?

571


What is the difference between break and continue commands?

576


What does $1 mean in bash?

614


How will you emulate wc –l using awk?

913


What is gui scripting?

605


i have 2 tables 4 colums table 1 respective values a1 6, a2 8,a3 9,a4 14 & table 2 respective values a1 6, a2 8, a3 9, a4 12. if compare 2 tables 3 colums values same then 4th column values 1)Qes diff >5 then (5 * diff value ) 2)Qes diff <5 the 5 3)Qes diff 5 then 5 print respective values..

1791


Differentiate between ‘ and ” quotes.

615


Explain about echo command?

625


What is meant by $1 in shell script?

549