Hi!
I have to replace or erase some strings in a file.
I use following syntax:
sed -i '2d;3d;6d;7d;9d;10d' /opt/atpcu/vfw/bin/vfw.checksum
This command removes some lines within the file which are not needed and works great on the console.
I have also tried this commmand (also works on the console)
sed '2d;3d;6d;7d;9d;10d' /opt/atpcu/vfw/bin/vfw.checksum > /opt/atpcu/vfw/bin/vfw.checksum.bak
mv /opt/atpcu/vfw/bin/vfw.checksum.bak /opt/atpcu/vfw/bin/vfw.checksum
On the console this commands work perfectly, but when I execute this command within the postinstall script of a debian packet it leaves me the file empty after installation of that debian packet.
Any ideas why?
Oh, I also do some other replacements on other files within the postinstall script like:
sed -i 's|.*/Linux_ppc/TEST|'/optrd/run/TEST'|g' /opt/TEST/etcsc/bin/TEST.check 2> /dev/null
and this command works both on console and within the postinstall script(changed file is not empty!)
regards
Adam