Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while getopts tcx: tmp
- do
- case $tmp in
- t) TFLAG=true
- words=`ls -l | grep '...x..x..x' | awk '{print $10}' | grep .txt$`
- if [ -n "$words" ]
- then
- echo $words
- else
- echo "No such file exists"
- fi
- ;;
- c) CFLAG=true
- words=`ls -l | grep '...x..x..x' | awk '{print $10}' | grep .c$`
- if [ -n "$words" ]
- then
- echo $words
- else
- echo "No such file exists"
- fi
- ;;
- x) XFLAG=true
- words=`ls -l | grep '...x..x..x' | awk '{print $10}' | grep "$OPTARG"`
- if [ -n "$words" ]
- then
- echo $words
- else
- echo "No such file exists"
- fi
- ;;
- esac
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement