Results 1 to 2 of 2
Write a Bash shell script that receives only one argument via command line. (Ensure that the argument must be exactly one and it must be a directory which is owned ...
- 04-30-2010 #1Just Joined!
- Join Date
- Apr 2010
- Posts
- 1
need help in question !!!
Write a Bash shell script that receives only one argument via command line. (Ensure that the argument must be exactly one and it must be a directory which is owned by you. If not the script exits). The script should display the number of readable, writable and executable files in that directory.
For the question written above please recommend me any solution .... i have written a code but its not giving me valid output .. u can also see my code below :
#!/bin/bash
read=0
write=0
exec=0
if [ $# -eq 1 -a -d "$1" ]
then
ls $1 > perm
for var in $( cat perm )
do
if [ -r "$var" ]
then
read=`expr $read + 1`
fi
done
else
echo "Error"
this is just for checking the readable ..... rest of other are like the same ....
- 04-30-2010 #2
Hi and Welcome !
We can't help you in Homework questions/assignments. Its against Forum Rules.
I would suggest you go through a few bash tutorials. Don't hesitate to start a new thread if you have any specific problem.It is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First


