On 04/27/2014 08:54 PM, Carlos E. R. wrote:
while read FILES ; do if [ -f "$FILES" ]; then TIPO=`head -c 1000 "$FILES" | file - | grep Bourne-Again` if [ $? -eq 0 ]; then echo "$FILES" >> $LISTADO_SCRIPTS fi fi done < $LISTADO_FIND
Notes:
a) The test for "regular file" is needed, because the find, despite using "find "$DONDE" -type f ..." finds some directories, and thus I get some errors later:
head: error reading ‘/var/run/vmblock-fuse/dev’: Invalid argument
Very unlikely - there's something wrong in $LISTADO_FIND. However it was produced ... it contains directories.
b) The use of:
head -c 1000 "$FILES" | file -
instead of directly:
file "$FILES"
is because "file" takes an awful amount CPU time to find out the types of all the files I feed it with, some of them huge (several gigabytes).
Maybe: find ... -size -100k ,,, assuming that shell script are usually smaller than 100k (okay, java shell installers are bigger, of course). Have fun, Berny -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org