Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #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 :



    if [ $# -eq 1 -a -d "$1" ]

    ls $1 > perm
    for var in $( cat perm )

    if [ -r "$var" ]

    read=`expr $read + 1`

    echo "Error"

    this is just for checking the readable ..... rest of other are like the same ....

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Chandigarh, India
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts