O'Reilly logo

Linux and Unix Shell Programming by David Tansley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Command execution order

When executing commands, you occasionally need to know that one command has completed successfully or failed before carrying on with another command. For example, suppose you wanted to copy all the files from one directory to another directory, then delete the source directory. You’ll want to know for sure that the copy went OK first before you blitz the original directory, otherwise you could lose all your source directory contents.

In this chapter we will cover:

  • command execution control; and

  • command grouping.

The shell has a couple of commands that will not execute the second commands unless the first went OK or execute the second command if the first one failed. The operators that can take care of these ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required