Nп/п : 82 из 100
 От   : Andy Walker                         2:5075/128        19 сен 23 11:30:16
 К    : Keith Thompson                                        19 сен 23 13:33:04
 Тема : Re: sed -i `/%sudo/c %sudo ALL=(ALL:ALL) NOPASSWD:ALL` /etc/sudoers
----------------------------------------------------------------------------------
                                                                                 
@MSGID: 1@dont-email.me> af8a8a25
@REPLY: <874jjqk812.fsf@nosuchdomain.example.com>
499e16ac
@REPLYADDR Andy Walker <anw@cuboid.co.uk>
@REPLYTO 2:5075/128 Andy Walker
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID: 1@dont-email.me>
@RFC-References:
<f1c33e51-6c3b-4e7a-ab15-fd694fdee755n@googlegroups.com> <874jjqk812.fsf@nosuchdomain.example.com>
@TZUTC: 0100
@PID: Mozilla/5.0 (X11; Linux i686; rv:102.0)
Gecko/20100101 Thunderbird/102.11.0
@TID: FIDOGATE-5.12-ge4e8b94
On 19/09/2023 07:10, Keith Thompson wrote:
[Sed:]
> The `c` command is a GNU extension.

The "c" /command/ was "original", and is in 7th Edition Unix.
But originally it had to be followed /immediately/ by a backslash,
with the replacement text on the following line(s).  On my current
[Linux] machine, "man sed" shows optional space(s) between "c" and
the backslash [which is presumably the GNU extension, as it`s an
obvious change to make on a re-write].  But it doesn`t show the extra
[also obvious] possibility of the replacement text on the same line,
for which, as you suggest, you need "info sed".

Personally, I prefer "man" to "info", if available, as the
output is formatted nicely, so it`s understandable that the extra
extension should be overlooked.  OTOH, once spaces are allowed, it`s
harder to exclude the same-line extensions to "a", "c" and "i" than
to allow them, so perhaps the documentation should emphasise the
same-line version and then point out the usefulness of backslashes.

[To Zhao:]
> (Seriously, I wonder why checking the documentation wasn`t your first
> thought before posting here.)

Perhaps he enjoys getting a rise out of people who wonder why
he prefers asking here to checking elsewhere?  It`s not as though this
is the first example of its type over the past decade and more.

-- 
Andy Walker, Nottingham.
    Andy`s music pages: www.cuboid.me.uk/andy/Music
    Composer of the day: www.cuboid.me.uk/andy/Music/Composers/Praetorius
--- Mozilla/5.0 (X11; Linux i686; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
 * Origin: Not very much (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх