diff --git a/shell_scripting_succinctly/exercise4.sh b/shell_scripting_succinctly/exercise4.sh new file mode 100755 index 0000000..44610ad --- /dev/null +++ b/shell_scripting_succinctly/exercise4.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +FILE_NAME="/etc/shadow" + +if [ -e $FILE_NAME ] +then + echo "Shadow passwords are enabled." + if [ -w $FILE_NAME ] + then + echo "You have permissions to edit /etc/shadow." + else + echo "You DO NOT have permissions to edit /etc/shadow" + fi +else + exit +fi +