Hello i want to change symlink path to real path in txt file. First I find word "SF:" and change path. Now i use this script but it is slow and not effective. I think it can be changed by awk or sed command. Thank you in advance.
#!/bin/bash
FILENAME="new1.info"
echo "" > $FILENAME
while read LINE
do
if [ "" != "$(echo $LINE | grep -e "^SF:")" ]
then
echo "SF:""$(realpath $(echo $LINE | cut -d":" -f2))" >> $FILENAME
else
echo $LINE >> $FILENAME
fi
done < total.info
I have big txt file, so I want to find "SF:" and change line from something like this:
SF:/home/ects/svn/moduleTests/ctest/tests/moduletests/base/tmp/src/base64.cpp
To this:
SF:/home/ects/svn/moduleTests/ctest/src/base/base64.cpp