Skip to content

Instantly share code, notes, and snippets.

@handakumbura
Created February 22, 2017 06:24
Show Gist options
  • Save handakumbura/3676452b1e2d178b91ddd8e490bbbe5d to your computer and use it in GitHub Desktop.
Save handakumbura/3676452b1e2d178b91ddd8e490bbbe5d to your computer and use it in GitHub Desktop.
#!/bin/bash
#A convenient way to check if bash scripts contain syntax errors using the bash -n command.
INTERVAL=10
while [ 1 -gt 0 ]; do
bash -n "$1"
if [ $? == 0 ]; then
echo 'No Syntax errors were found. Keep marching on soldier!'
fi
sleep $INTERVAL; #check interval
clear
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment