getting issue while using sed with variable in shell script

Published: 5/10/2017
getting issue while using sed with variable in shell script
Source: UNIX.STACKEXCHANGE.COM

I using shell script to replace a number in the text file . Content of file is: cat file 7.0.78 | 8.0 | 7.0.47 And I am using below command . This is working from command prompt but not from script. Actual=8.0.44.0 sed -i -e "s/8.0/$Actual/g" file I am getting output as | 7.0.478.0.44.0 from debug mode , I noticed that my variable become as: + Actual=$'8.0.44.0\r' + echo $'8.0.44.0\r' Plea

Read more
Related news
Comment