Check arguments in your Bash script (Bash )

Check arguments in your Bash script

With test -z we can check if a variable’s length is zero. If that is the case, we print some friendly usage instructions instead of failing miserably.

Edit and run this Bash example code

This code is editable and runnable. You can run "Check arguments in your Bash script" by pressing the run button. It will be executed in our backend and the result (stdout and stderr) is displayed in addition tabs.