From: Andrei Popescu on
On Fri,28.May.10, 15:19:21, Dotan Cohen wrote:

> sed or awk. But I've been reading sed and awk tutorials for two hours
> and I cannot figure out how to remove line N from the file without
> creating a second file. If I'm already going through the hassle of
> creating then moving a second file then I might as well just edit the
> file in VIM.
>
> Any ideas?

The '-i' option for sed?

Regards,
Andrei
--
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
From: Tixy on
On Fri, 2010-05-28 at 15:19 +0300, Dotan Cohen wrote:
<snip>
> I'd like to just remove line 44 from
> ~/.ssh/known_hosts. Easy to do in VIM, probably even easier to do in
> sed or awk.
<snip>

The -i option edits files in place, so...

sed -i 44d ~/.ssh/known_hosts


--
Tixy () The ASCII Ribbon Campaign (www.asciiribbon.org)
/\ Against HTML e-mail and proprietary attachments


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/1275050284.2184.2.camel(a)computer2.home
From: Dotan Cohen on
On 28 May 2010 15:27, Andrei Popescu <andreimpopescu(a)gmail.com> wrote:
> On Fri,28.May.10, 15:19:21, Dotan Cohen wrote:
>
>> sed or awk. But I've been reading sed and awk tutorials for two hours
>> and I cannot figure out how to remove line N from the file without
>> creating a second file. If I'm already going through the hassle of
>> creating then moving a second file then I might as well just edit the
>> file in VIM.
>>
>> Any ideas?
>
> The '-i' option for sed?
>

Thanks, Andrei. You know, I read the manage twice and that just did
not register! Have a great weekend.


--
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/AANLkTimAUmyVPDj0rtS9JPgRG46tHFqY2c6pzBYvhQ0o(a)mail.gmail.com
From: Dotan Cohen on
On 28 May 2010 15:38, Tixy <debianuser(a)tixy.myzen.co.uk> wrote:
> The -i option edits files in place, so...
>
>    sed -i 44d ~/.ssh/known_hosts
>

Thanks, I was simply missing the -i option. My weekend starts in less
than one hour, must be related.


--
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/AANLkTin6_oA3LnC4y8qKfhmBXhr_1tZdOWzcLeBSIdKu(a)mail.gmail.com
From: James Brown on
Andrei Popescu wrote:
> On Fri,28.May.10, 15:19:21, Dotan Cohen wrote:
>
>
>> sed or awk. But I've been reading sed and awk tutorials for two hours
>> and I cannot figure out how to remove line N from the file without
>> creating a second file. If I'm already going through the hassle of
>> creating then moving a second file then I might as well just edit the
>> file in VIM.
>>
>> Any ideas?
>>
>
> The '-i' option for sed?
>
> Regards,
> Andrei
>

Is there such option for awk?


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/4C0631E2.2060504(a)gmail.com