Process Execution

This section provides a quick overview of how the Korn shell interacts with Unix. For the following sections, it is assumed that you are logged as a regular user, therefore you have the default command prompt - $.

Multiple Commands

Multiple commands can be given on the same line if separated with the ; character. Notice that the command prompt is not displayed until the output from all three commands is displayed:

						$ pwd ; ls dialins ; echo Hello
						/home/anatole
						dialins
						Hello
						$
					

This is also useful when you want to run something more complex from the command line, like rename all the files in the current directory using flow control commands:

						$ for i in $(ls); do mv $i $i.bak; done
					

The for loop command is covered in more detail ...

Get Korn Shell: Unix and Linux Programming Manual, Third Edition, The now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.