Hi all.
I need help with a command to locate a substring from a string.
My problem is I am passing a direcotry name as a command line argument and I need to ensure that user should not pass certain directories.
E.g ther are Directories under ==> /opt/projects/* which should not be passed as a paramerter. Is there a way to achieve this?
Thanks in anticipation!
maybe check $1 if it contains string "/opt/projects/" else just continue.
kshji
3
dest="$path"
case "$path" in
/opt/projects/*) dest="." ;;
/some/*) dest="." ;;
esac
cd $dest
Much better is to set priviledges, for some special group or user and remove other priviledges
ex. remove all priviledges from group members and others
cd opt
chmod -R g-rwx projects
chmod -R o-rwx projects
=> only owner can do something