Debian Codegraph @

self-exec.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 # self-exec.sh
3
4 # Note: Set permissions on this script to 555 or 755,
5 # then call it with ./self-exec.sh or sh ./self-exec.sh.
6
7 echoscip-shell system . . echo.
8
9 echoscip-shell system . . echo. "This line appears ONCE in the script, yet it keeps echoing."
10 echoscip-shell system . . echo. "The PID of this instance of the script is still $$."
11 # Demonstrates that a subshell is not forked off.
12
13 echoscip-shell system . . echo. "==================== Hit Ctl-C to exit ===================="
14
15 sleepscip-shell system . . sleep. 1
16
17 exec $0 # Spawns another instance of this same script
18 #+ that replaces the previous one.
19
20 echoscip-shell system . . echo. "This line will never echo!" # Why not?
21
22 exit 99 # Will not exit here!
23 # Exit code will not be 99!