/filefind/bash/Makefile |
---|
1,9 → 1,9 |
DIR = /home/arikkert |
SRC = filefind.bash |
PRG=$(SRC) |
DIR=/var/tmp |
test: $(SRC) |
./$(SRC) $(DIR) > result |
test: $(PRG) |
./$(PRG) $(DIR) > result |
sort result > result.sort |
find $(DIR) > result2 |
sort result2 > result2.sort |
10,7 → 10,6 |
wc *.sort |
diff *.sort |
clean: |
rm -f filefind |
rm -rf result result.sort |
rm -rf result2 result2.sort |
cleantest: |
rm -f result result.sort |
rm -f result2 result2.sort |
/filefind/bash/filefind.bash |
---|
39,10 → 39,12 |
curdir=$(pwd) |
cd -- "$directory" |
curdir2=$(pwd) |
files=$(ls) |
files=$(ls -a) |
for file in $files |
do |
pfile=$curdir2/$file # file including path |
if [ $file != ".." -a $file != "." ] |
then |
if [ -d "$file" -a ! -L "$file" ] |
then |
echo $pfile |
55,6 → 57,8 |
echo "WARNING: Could not process file $pfile" |
fi |
fi |
fi |
done |
cd -- "$curdir" |
} |