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

Script S1 (which copies .dat files from one directory1 to another directory2) run continuously. Write Script S2 which kills S1 first, compresses all .dat files in directory1 and directory2 successfully, re-run Script S1 and stops self i.e. S2.

2 Answers   IBM, TCS,


In a single command how do you run the previous command in the command prompt.

5 Answers  


What are the 3 standard streams in linux?

0 Answers  


What is another name for a bash shell script that you might see?

0 Answers  


how to delete all the files with extension .dat rom a directory tree from root to third level in a single unix command?

4 Answers  






Why is a script important?

0 Answers  


What is basename in shell script?

0 Answers  


how to print the matrix form of 2-d, 3-d arrays in unix c shell scripts ?

0 Answers  


What are types of shells?

0 Answers  


Write a shell program to test whether a given number is even or odd?

8 Answers  


How can I send a mail with a compressed file as an attachment?

0 Answers  


What are scripts in psychology?

0 Answers  


Categories