Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vologue #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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