Hi fellows:
I'm having a quite disturbing trouble with this simple script:
Code:
#!/bin/bash
DIR_HTML_UTF=/home/GGG_index/htmlUtf
vid=""
find $DIR_HTML_UTF -type f -name "*html" | sed 's/[^0-9]//g' | sort -u | while read vid; do
echo $vid
vids="$vids,$vid"
echo " >> ${vids:1}"
done
echo "=== $vids ==="
And the result of the script is:
Code:
101993
>> 101993
150115
>> 101993,150115
150188
>> 101993,150115,150188
32416
>> 101993,150115,150188,32416
93939
>> 101993,150115,150188,32416,93939
=== ===
I can't understand why $vids is empty after de loop. It's just too weird, isn't it?
I'm using a Ubuntu 10.04 64bits box.
Thx!