Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
The exit command sets the exit code in a calling shell script. Based on what happens in the child script, you can take some action in the parent.
Here is an example where parent.ss calls child.ss.
#!/bin/ksh
# parent.ss call child and look at exit code
./child.ss # execute the child
echo $? # should be 4
# end parrent.ss# child.ss exit set to 4
exit 4
# end child.ssThere is a limit to the exit value. It's probably system dependent, but as I remember it's around 256. If it matters, you'll have to check.

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |