Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.


Problem listing all files in a script

Problem listing all files in a script

I knocked this together today but it is not listing all files in the while true FILE loop. I tried two variations, one with the ultimate endgame matching files which are go+w and one without. The idea is to check the files in each users home directory to ensure nothing is go+r.

lsuser -a home ALL |cut -f2 -d= | while read HOMEDIR; do [[ -d $HOMEDIR ]] && ls -a $HOMEDIR | grep -Ev "^.$|^..$" | while read FILE; do [[ -f $FILE ]] && ls -l "$HOMED
IR/$FILE"; done; done

#lsuser -a home ALL |cut -f2 -d= | while read HOMEDIR; do [[ -d $HOMEDIR ]] && ls -a $HOMEDIR | grep -Ev "^.$|^..$" | while read FILE; do [[ -f $FILE ]] && ls -l "$HOME
DIR/$FILE" |awk '{print $1 , $9}' |egrep '^-....w....|^-.......w.'; done; done

Any help is greatly appreciated.

RE: Problem listing all files in a script

Good questions - because this is AIX and I cannot stop the find command traversing directories (only limit is filesytem boundaries)

RE: Problem listing all files in a script

I had to do something similar on AIX a short while back - this is how I formatted the find command so that it would only look in the specified directory:



cd $SRC
find . ! -name . -prune -type f -mmin -1 -exec cp {} $DST \; 

If you use the above - specifically "find . ! -name . -prune" part and pair that up with -perm you should then be able to do what you want.

Add a little color to your PUTTY terminal: FAQ52-6627: Color ls script

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close