Handling temporary files in Bash -


i need copy , execute bash script within parent bash script, when job done (and if fails) need parent script remove child script file copied.

here's code snippet i'm working on:

if [ -e $repo_path/install ];   cp $repo_path/install $install_path   exec $install_path/install   rm $install_path/install fi 

this fails reason, seems exit altogether when child process ends. correct use exec example?

exec replaces current process, statements after never reached.

you may replace exec sh or bash, or remove if child script executable.

see also: the bash reference manual exec


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -