[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

doubt in using sed



I have made a script like this as test1
#!/bin/bash
line="3IINFOTECH,20050422000000,118,118,96,98.1,8260440"
olds=$(echo "$line"|cut -d, -f2)
echo $olds
da=${olds:0:8}
echo $da
echo "$line" > temp1
sed -e 's/$olds/$da/' temp1 >>temp
cat temp1
cat temp
When I run get as
lvgandhi@lvgdell600m:~/.qtstalker/data0/export$ test1
20050422000000
20050422
3IINFOTECH,20050422000000,118,118,96, 98.1,8260440
3IINFOTECH,20050422000000,118,118,96,98.1,8260440
I don't find any replacement. Where am I wrong? what should be done to get the replacement done?
--
L.V.Gandhi
http://lvgandhi.tripod.com/
linux user No.205042
Reply to: