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

Re: doubt in using sed



Hello.

L.V.Gandhi, 10.03.2007 00:01:
> 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

You want to use double quotes here so that the shell can expand the variables.


Regards, Mathias

-- 
debian/rules

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: