Write a shell program named HELOO (this should be done
linux)
Your program should set permissions for a file named A1testFile so
that
the current premissions remain, except execute permissions are
REMOVED
for everyone, including owner. Your must accomplish this with a
single
chmod command. A1testFile should be specified as a relative path
name
to a file in the current directory (the directory the user is in
when
they run your program). Your program should not display any
error
messages, even if A1testFile does not exist.
f="$1"
if [ -e $f ]
chmod ugo-x $f && echo "File Permission has been changed"
fi
Save the above script into HELOO.sh
now run this using...
./HELOO.sh A1testFile
alternatively if you do not want to enter file name via command line argument, you can pass the file name in script as shown below.
Save the below script with HELOO name with .sh extension and run directly, without passing any command line argument.
f="A1testFile"
if [ -e $f ]
chmod ugo-x $f && echo "File Permission has been changed"
fi
Get Answers For Free
Most questions answered within 1 hours.