From e7f3c13fb6cc5f36b9904cae7b74fe832c05f692 Mon Sep 17 00:00:00 2001 From: mlot Date: Sun, 1 Feb 2026 13:07:48 -0500 Subject: [PATCH] add exercise4.sh --- shell_scripting_succinctly/exercise4.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 shell_scripting_succinctly/exercise4.sh 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 +