Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- while true; do
- sleep 1
- echo "Slept 1"
- echo "Exit status $?, ok."
- sleep 1
- echo "Slept 1, now executing faulty command 'ps q'"
- ps q
- echo "Exit status $?, not ok. Loop continues forever..."
- done
- ./loop.sh
- Slept 1
- Exit status 0, ok.
- Slept 1, now executing faulty command 'ps q'
- ps: illegal option -- q
- usage: ps [-AaCcEefhjlMmrSTvwXx] [-O fmt | -o fmt] [-G gid[,gid...]]
- [-u]
- [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]
- ps [-L]
- Exit status 1, not ok. Loop continues forever...
- Slept 1
- Exit status 0, ok.
- Slept 1, now executing faulty command 'ps q'
- ps: illegal option -- q
- usage: ps [-AaCcEefhjlMmrSTvwXx] [-O fmt | -o fmt] [-G gid[,gid...]]
- [-u]
- [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]
- ps [-L]
- Exit status 1, not ok. Loop continues forever...
- ^C
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement