[clue] Bash baffler
David L. Anselmi
anselmi at anselmi.us
Thu Jun 5 16:43:36 MDT 2014
foo7775 at comcast.net wrote:
>
> #!/bin/bash
> set -x
> for i in $(`df -hl | awk '{print $NF}' | grep -v ^\/dev`);
> do
> # find $i -path /proc -prune -o -type f -perm +6000 -ls>> /tmp/Test1_"$HOSTNAME".txt
> echo $i| rev ;
> done
A couple of scripting comments.
awk programs have a pattern component so you rarely need awk to feed grep (or vice versa).
find will operate on multiple paths so you probably don't need the for loop (unless your command
line gets too long in which case you want xargs).
You're sure your list of paths doesn't contain unexpected white space, right?
Dave
More information about the clue
mailing list