Way to exit bash script outside of a function, but not quitting the terminal

I was in a situation where I wanted to stop executing lines but not exit the terminal

So I put a return command but got an error saying that “return: can only return’ from a function or sourced script”

https://stackoverflow.com/questions/9640660/any-way-to-exit-bash-script-but-not-quitting-the-terminal

Leave a Reply

Your email address will not be published.