Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #265626

Re: OT: coloured text?

From Greg Wooledge <greg@wooledge.org>
Newsgroups linux.debian.user
Subject Re: OT: coloured text?
Date 2024-01-07 21:00 +0100
Message-ID <HTHto-1vBb-13@gated-at.bofh.it> (permalink)
References <HTGnD-1uZv-3@gated-at.bofh.it> <HTGGZ-1vln-3@gated-at.bofh.it> <HTGQG-1voC-9@gated-at.bofh.it> <HTH0l-1vrM-5@gated-at.bofh.it> <HTH0l-1vrM-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Jan 07, 2024 at 07:28:12PM +0000, Michael Kjörling wrote:
> On 7 Jan 2024 14:20 -0500, from greg@wooledge.org (Greg Wooledge):
> >> #!/bin/sed -e 1d
> > 
> > This is not a valid shebang.  You're only permitted ONE argument after
> > the interpreter name.  You're going to execute /bin/sed '-e 1d' 'filename'
> > with this.
> 
> Okay, fair point. In my defense, I tried it and it worked.

unicorn:~$ seq 5 | sed '-e 1d'
2
3
4
5

Hmm... my first thought was that GNU sed is being lenient here, but on
further reflection I'm not sure about that.  This is equivalent to
sed -e ' 1d' (with a leading space in front of the script which is the
option-argument of -e).  And perhaps sed permits leading whitespace in
each line of its scripts, for purposes of readability.

In any case, trying to put multiple arguments on the shebang won't work
in general.  It's a well-known behavior, and is why GNU env(1) has -S.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

OT: coloured text? Hans <hans.ullrich@loop.de> - 2024-01-07 19:50 +0100
  Re: OT: coloured text? Greg Wooledge <greg@wooledge.org> - 2024-01-07 20:10 +0100
    Re: OT: coloured text? Michael Kjörling <2695bd53d63c@ewoof.net> - 2024-01-07 20:20 +0100
      Re: OT: coloured text? Michael Kjörling <2695bd53d63c@ewoof.net> - 2024-01-07 20:30 +0100
        Re: OT: coloured text? Greg Wooledge <greg@wooledge.org> - 2024-01-07 21:00 +0100
      Re: OT: coloured text? Greg Wooledge <greg@wooledge.org> - 2024-01-07 20:30 +0100
  Re: OT: coloured text? Kent West <westk@acu.edu> - 2024-01-07 20:10 +0100

csiph-web