I'm facing an issue since yesterday, trying to search on the internet how to fix it... Without result.
There it is. This is my program :
OTHERDIR="/tech/gtr/scripts/osm/scan-configs"
filename="IDF-952584-SW1-126.110.84.253"
estdifferent=true;
if $estdifferent ; then
x=0;
for fic in `find $OTHERDIR/liste/ -type f -name $filename*` ; do
{
echo $fic
if [[$fic == *bak*]]
then
filename_tab[x]=$fic
((x++))
fi
}
I want to check if $fic contains * bak * at the end
But the debug show me this when it arrives at the "if" instruction :
'[[/tech/gtr/scripts/osm/scan-configs/liste/IDF-952584-SW1-126.110.84.253_bak1' == '*bak*]]'
comparatif.sh: line 29: [[/tech/gtr/scripts/osm/scan-configs/liste/IDF-952584-SW1-126.110.84.253_bak1: No such file or directory
Why is it telling me "no such file or directory" ? I'm comparing a var and a regex. (Line 29 is the IF $fic == * bak * instruction)