Dear all,
In a bash script, I grep a filename from an UTF8 encoded file:
LIST=`grep ^source $FILE | tr "\t" " " | cut -d " " -f 2 | sed -e 's,~,\$HOME,g'`
The result is
# echo $LIST
$HOME/.mail_aliases_seminaire_MMMG
Then I try to access it:
#ls $LIST
ls: cannot access $HOME/.mail_aliases_seminaire_MMMG: No such file or directory
while in the same script I can access the file hard coding its name
ls $HOME/.mail_aliases_seminaire_MMMG
/home/me/.mail_aliases_seminaire_MMMG
I wondered whether it's an encoding effect, however:
#echo $LIST | od -t oC -An > /tmp/CS
#echo '$HOME'/.mail_aliases_seminaire_MMMG | od -t oC -An | sdiff - /tmp/CS
044 110 117 115 105 057 056 155 141 151 154 137 141 154 151 044 110 117 115 105 057 056 155 141 151 154 137 141 154 151
163 145 163 137 163 145 155 151 156 141 151 162 145 137 115 163 145 163 137 163 145 155 151 156 141 151 162 145 137 115
115 107 012 115 107 012
Any idea?