Hi.
I have a script to find files in a directory. Lately I found an issue using find. It doesn't seem to find anything anymore, if the slash on the end of the search path is missing.
This works:
Code: Select all
#!/bin/bash
rm -f /root/tmp/Win-VST-List.txt
Path="/root/Win-VST/"
Files=`find "$Path" -maxdepth 8`
echo "$Files" |while read F
do
if [[ "$F" != "" && "$F" = *.so ]]; then
#echo "$F"
echo "`basename "$F"`"
echo "`basename "$F"`" >>/root/tmp/Win-VST-List.txt
fi
done
Though, this doesn't work (at least on my machine with Bionic64)
Code: Select all
#!/bin/bash
rm -f /root/tmp/Win-VST-List.txt
Path="/root/Win-VST"
Files=`find "$Path" -maxdepth 8`
echo "$Files" |while read F
do
if [[ "$F" != "" && "$F" = *.so ]]; then
#echo "$F"
echo "`basename "$F"`"
echo "`basename "$F"`" >>/root/tmp/Win-VST-List.txt
fi
done
In my older Puppies e.g. Tahr it doesn't make a difference. Now I have to edit lots of my scripts.
When was this changed?