Re: SED help........
On Fri, Apr 23, 2004 at 11:39:32AM -0400, Ralph Crongeyer wrote:
> Hi all,
>
> I need some help with SED. I'm trying to insert a "command"/text at the
> beginning of every line from one file and output to a new file like this:
>
> sed 's/.*/clamscan -ri -l /var/log/clamav/clamav-"$1".log
> --move=/var/log/clamav/quarantine &/ /var/log/clamav/diff/diff.txt >
> /var/log/clamav/virus_scan
1. There is no 2nd ' (should it be after clamscan?)
2. s/.*/clamscan means (I think) that the whole line is replaced with the word
clamscan which is probably not what you want.
>
> but sed givs me this error:
> sed: -e expression #1, char 23: Unknown option to 's'
>
> I have also tried to use the insert command i\ but it just inserts the
> text on a new line above each of the lines read from the file instead of
> just inserting the text at the beginning of each of the lines red from
> the file?
>
> Can someone help me with this?
>
> Ralph
>
>
HTH
--
Joachim Fahnenmüller
# Hi! I'm a .signature virus. Copy me into
# your ~/.signature to help me spread!
Reply to: