I'm making a script that eventually starts over by executing itself again using exec. The problem is the first few lines are only supposed to be run everytime you launch the script yourself, so I'm wondering if there's any thing I can do to fix this. Here's an example:echo welcomeread yesnoif [[ $something = etc.. ]]; thenwhateverfiexec ~/bin/scriptThis is simplified but it this were my script I would want to ignore the first line, (echo). Is there some option to exec I can add? I mean I could make a copy of the script and just omit the first line(s), but it feels like a bad solution.
Ignore first x lines when executing a script?
bash;shell;terminal;exec
With a variable, the obvious thing to do is to pass in the result from the previous prompt:if [[ -z $yesno ]]; then    echo welcome    read yesnofiif [[ $something = etc.. ]]; thenwhateverfi# doing it this way makes it exported into the subprocessyesno=$yesno exec ~/bin/script