santanudas
Technical User
I’ve got another problem with bash script. If I do this on the console I get it write:
But running it as a script, I get it wrong:
Any idea why? Any help is very much appreciated. Many Thanks!!
Code:
[MacUsers@pcge ~]$ find ~/scripts -type l | grep iTest
/home/MacUsers/scripts/iTest File
[MacUsers@pcge ~]$ find ~/scripts -type l | grep iTest | sed 's/ /\\ /g'
/home/MacUsers/scripts/iTest\ File
Code:
#!/bin/bash -f
#
OLDIFS=$IFS
IFS=''
for file in $( find ~/scripts -type l | grep iTest )
do
echo $file
done
DAS=`echo ${file} | tr '' \\\n | sed 's/ /\\ /g'`
echo "The new one :: " $DAS