[mythtv-users] Off topic. Use of AWK?

David Frankland david at dmf-software.co.uk
Fri Oct 24 23:24:54 UTC 2008


Mark Hutchinson wrote:
> Off topic, but I bet some expert here knows how to do this.
> I think awk or sed may be the way to go?
>
> I simply want to append an asterisk to the first 3 lines of a file.
>
> eg.
> test
> test
> test
> test
> test
> test
>
> to
>
> *test
> *test
> *test
> test
> test
> test
>
> I need to do this on many files.
>
> What would the command be to do this?
try:

sed -i "1,3s/^/*&/" filename-goes-here

you can use wildcards, eg *.txt for the filename
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3265 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20081025/df7e042c/attachment.bin 


More information about the mythtv-users mailing list