insert file?
Mikkel L. Ellertson
mikkel at infinity-ltd.com
Wed Nov 28 16:28:19 UTC 2007
Mikkel L. Ellertson wrote:
> Frank Cox wrote:
>> On Wed, 28 Nov 2007 23:26:25 +0800 (CST)
>> adrian kok <adriankok2000 at yahoo.com.hk> wrote:
>>
>>> Please help how insert `who` in the third line of the
>>> file
>> man sed
>>
> I think he wanted to insert the output of the who command in the
> file. It that is the case, then it gets a bit more complicated,
> because you are trying to insert multiple lines.
>
> You could do something like:
>
> who | sed -i -e2r/dev/stdin <file name>
>
I forgot to add that using the -i will change the original file. If
you want to create a new file, you could use:
who | sed -e2r/dev/stdin <file name> > <new file>
Mikkel
--
Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20071128/654ce95e/attachment-0001.sig>
More information about the fedora-list
mailing list