Challenge Yourself
See following bash code and answer what the output is without running it
https://github.com/vumdao/bash/blob/master/bash_test/wq.sh
#!/bin/bash
set -e
mutex_test() { return -23; }
mutex_test
echo $?
echo "Done"
For further actions, you may consider blocking this person and/or reporting abuse
Pradumna Saraf -
Jessica Wang -
Jessica Wang -
Philip Miglinci -
Once suspended, vumdao will not be able to comment or publish posts until their suspension is removed.
Once unsuspended, vumdao will be able to comment and publish posts again.
Once unpublished, all posts by vumdao will become hidden and only accessible to themselves.
If vumdao is not suspended, they can still re-publish their posts from their dashboard.
Once unpublished, this post will become invisible to the public and only accessible to 🚀 Vu Dao 🚀 .
They can still re-publish the post if they are not suspended.
Thanks for keeping DEV Community safe. Here is what you can do to flag vumdao:
Unflagging vumdao will restore default visibility to their posts.
Top comments (2)
I use the
shellcheck
tool as described here:devdojo.com/guide/bash/debugging-a...
You can use their website directly or you could install the CLI tool as well.
It is very handy, it gives you some suggestions on some best practices too.
If you run it via bash or make it executable and run it, it'll presumably either display nothing (which is what I expect to happen because -23 is non-zero and
set -e
means bomb out whenever anything returns non-zero) or possibly display -23 (if it doesn't count in a function, but I don't think that's the case).If you source/dot the file to run it in the current context, you'll end up closing your shell.