How to group the commands in shell scripting?

Answers were Sorted based on User's Feedback



How to group the commands in shell scripting?..

Answer / linuxdemon(vjsujay@gmail.com)

(unix cmd 1; unix cmd2)

eg:

ubuntu@ubuntu:~$ (w > fname ; wc -l fname)
10 fname
ubuntu@ubuntu:~$

Is This Answer Correct ?    10 Yes 2 No

How to group the commands in shell scripting?..

Answer / tony

The command separator is ;

So, just run:

$ echo Let me wait some time ; sleep 10 ; echo Yes, that is OK

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Shell Script Interview Questions

What are the default permissions of a file when it is created?

0 Answers  


What is console line?

0 Answers  


A file has multiple records each having three 30-bit long fields(field1,field2,field3).There is also a lookup file,LOOK_UP.dat.Now, we need to consider only the last ten digits of field1 and lookup the file LOOK_UP.dat. If there a match then field2 and field3 should replaced with corresponding data from the lookup file. otherwise that particular record,for which there is no match, should be stored in a seperate file.

2 Answers   Wipro,


Which shell is the best?

0 Answers  


What are the different methods available to run a shell script?

2 Answers  






What is the default ubuntu terminal?

0 Answers  


What are the 3 standard streams in linux?

0 Answers  


How to print all array elements and their respective indexes?

0 Answers  


What is the difference between a shell variable that is exported and the one that is not exported?

6 Answers  


What does it mean to debug a script?

0 Answers  


What does debug script mean?

0 Answers  


What is the use of a shebang line?

0 Answers  


Categories