Skip to content

Instantly share code, notes, and snippets.

@siran

siran/blog.md Secret

Created February 17, 2020 03:54
Show Gist options
  • Save siran/0250d588c43922112d98e8f22b330ec9 to your computer and use it in GitHub Desktop.
Save siran/0250d588c43922112d98e8f22b330ec9 to your computer and use it in GitHub Desktop.

The other day I was running a Bash script. It wasn't working as expected so it needed some debugging.

I needed a quick-and-dirty solution.

After some googling, I found this answer. It ended up being quite easy and handy.

All you have to do is place this line on the top of your script and Bash will prompt you after executing every line. Hitting enter key is enough to execute the next line of your script.

https://gist.github.com/f2a1f7c3f93e2be41ab1db5fa708ff58

It is reported that this works "with bash v4.2.8 and v3.2.25."

For me, it worked like a charm.

Here is the original answer in stackoverflow.


Do you have other tips for debugging Bash? I'd like to know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment