Browse Source

Executing a list of commands

master
Anthony Fadly 1 year ago
parent
commit
abc8403e94
1 changed files with 14 additions and 0 deletions
  1. 14
    0
      sep19-more-commands.md

+ 14
- 0
sep19-more-commands.md View File

@@ -32,3 +32,17 @@ $ echo $PATH
```

When a command is run, the system checks these locations for them.

## Executing a list of commands

```
$ cmd1; cmd2 # do cmd1, then do cmd2

$ echo $? # echo the status of cmd2 ($? is the status if the last command)

$ cmd1 # do cmd1

$ echo $? # echo the exit status of cmd1

$ cmd1 && cmd2 # do cmd1, if cmd1 worked, do cmd2
```

Loading…
Cancel
Save