Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 27 additions & 13 deletions Tasks/00/vologue
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
#!/bin/bash
if [ -d $1 ]
then
sudo chmod -R $2 $1
if [ $? != 0 ]
then
echo "Operation not permitted or Permission bit is not set right"
else
echo "New Permissions Set"
ls -al $1
fi
else
echo "Directory is not present"
fi
echo "Enter File/Directory name :"
read pat
echo "Enter the permisions you wanna set (read,readwrite, readwriteexecute):"
read perm
case "$perm" in
"read")
chmod -R a+r-wx $pat
;;&
"readwrite")
chmod -R a+rw-x $pat
;;&
"readwriteexecute")
chmod -R a+rwx $pat
;;&
"write")
chmod -R a+w-rx $pat
;;&
"readexecute")
chmod -R a+rx-w $pat
;;&
"writeexecute")
chmod -R a+wx-r $pat
;;&
"execute")
chmod -R a+wx-r $pat
esac
ls -l $pat