Open a shell script from other script and close the first -
i want know how call script script ( know ) also, close first script process remains in background.
i use this:
#!/bin/bash #script echo "first script" ./ second.sh when this, first script remains in background, and, when close second script exit command, returns first script.
use exec:
exec second.sh this replaces original shell (script) new one.
the notation ./ won't work; can't execute current directory. if thinking of . second.sh, reads new script current script. if thinking of ./second.sh, need write exec ./second.sh.
strictly, first script not in background; waiting executed program (which happens second shell script) finish. 'in background' has specific connotations of 'running', whereas first script not actively running when run second.sh.
Comments
Post a Comment