Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Last yeer I kudn't spel Engineer. Now I are won.


devel / comp.unix.shell / Shell script doesn't accept arguments (maybe OT?)

SubjectAuthor
* Shell script doesn't accept arguments (maybe OT?)Ottavio Caruso
+* Re: Shell script doesn't accept arguments (maybe OT?)Tom Furie
|`- Re: Shell script doesn't accept arguments (maybe OT?)Ottavio Caruso
`* Re: Shell script doesn't accept arguments (maybe OT?)Kenny McCormack
 `* Re: Shell script doesn't accept arguments (maybe OT?)Ottavio Caruso
  +- Re: Shell script doesn't accept arguments (maybe OT?)Kenny McCormack
  +- Re: Shell script doesn't accept arguments (maybe OT?)Helmut Waitzmann
  `* Re: Shell script doesn't accept arguments (maybe OT?)Ed Morton
   `* Re: Shell script doesn't accept arguments (maybe OT?)Janis Papanagnou
    `- Re: Shell script doesn't accept arguments (maybe OT?)Jalen Q

1
Shell script doesn't accept arguments (maybe OT?)

<u0erqc$30uas$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6078&group=comp.unix.shell#6078

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: ottavio2...@yahoo.com (Ottavio Caruso)
Newsgroups: comp.unix.shell
Subject: Shell script doesn't accept arguments (maybe OT?)
Date: Mon, 3 Apr 2023 15:36:44 +0000
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <u0erqc$30uas$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 3 Apr 2023 15:36:44 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="352d8613165950cf63cf210facb23dcc";
logging-data="3176796"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+q0xXGZSCVf5hL4ByXZTXGv6+o+Ngy/nU="
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101
Firefox/102.0
Cancel-Lock: sha1:BPdCM8DD3gHpgmt1yKfubDzqAMo=
X-No-Archive: Yes
Content-Language: en-GB
 by: Ottavio Caruso - Mon, 3 Apr 2023 15:36 UTC

Hi,

I'm trying to narrow this down to either my script or Firefox itself.

I have a rudimentary shell launcher:

$ cat opt/bin/ff-accel
#!/bin/sh
env MOZ_X11_EGL=1 /home/oc/opt/firefox/firefox

(This is necessary to have Firefox understand video acceleration)

The script is executable:

$ ls -l opt/bin/ff-accel
-rwxr-xr-x 1 oc oc 67 Apr 3 10:52 opt/bin/ff-accel

If I launch Firefox normally:

$ /home/oc/opt/firefox/firefox www.google.com

I get the Google homepage as expected.

If I launch it this way:

$ opt/bin/ff-accel www.google.com

I just get a new instance of FF with a blank page.

I must have missed a simple thing but I have no idea which one.

Thanks.

--
Ottavio Caruso

Re: Shell script doesn't accept arguments (maybe OT?)

<u0es5r$p8s$1@freeq.furie.org.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6079&group=comp.unix.shell#6079

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!news.furie.org.uk!.POSTED.2001:470:1f1d:50e:f425:35ff:fe70:8d66!not-for-mail
From: tom...@furie.org.uk (Tom Furie)
Newsgroups: comp.unix.shell
Subject: Re: Shell script doesn't accept arguments (maybe OT?)
Date: Mon, 3 Apr 2023 15:42:51 -0000 (UTC)
Organization: Little to None
Message-ID: <u0es5r$p8s$1@freeq.furie.org.uk>
References: <u0erqc$30uas$1@dont-email.me>
Injection-Date: Mon, 3 Apr 2023 15:42:51 -0000 (UTC)
Injection-Info: freeq.furie.org.uk; posting-host="2001:470:1f1d:50e:f425:35ff:fe70:8d66";
logging-data="25884"; mail-complaints-to="usenet@furie.org.uk"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:0S0T+o9Za1U4iMuvIim0fQR+4AA=
 by: Tom Furie - Mon, 3 Apr 2023 15:42 UTC

On 2023-04-03, Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
> I have a rudimentary shell launcher:
>
> $ cat opt/bin/ff-accel
> #!/bin/sh
> env MOZ_X11_EGL=1 /home/oc/opt/firefox/firefox
>
> If I launch Firefox normally:
>
> $ /home/oc/opt/firefox/firefox www.google.com
>
> I get the Google homepage as expected.
>
> If I launch it this way:
>
> $ opt/bin/ff-accel www.google.com
>
> I just get a new instance of FF with a blank page.

You're ignoring any arguments you pass to your script.

Cheers,
Tom

Re: Shell script doesn't accept arguments (maybe OT?)

<u0etgg$1tp3k$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6080&group=comp.unix.shell#6080

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.shell
Subject: Re: Shell script doesn't accept arguments (maybe OT?)
Date: Mon, 3 Apr 2023 16:05:36 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <u0etgg$1tp3k$1@news.xmission.com>
References: <u0erqc$30uas$1@dont-email.me>
Injection-Date: Mon, 3 Apr 2023 16:05:36 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="2024564"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Mon, 3 Apr 2023 16:05 UTC

In article <u0erqc$30uas$1@dont-email.me>,
Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
>Hi,
>
>I'm trying to narrow this down to either my script or Firefox itself.
>
>I have a rudimentary shell launcher:
>
>$ cat opt/bin/ff-accel
>#!/bin/sh
>env MOZ_X11_EGL=1 /home/oc/opt/firefox/firefox

This needs to be:

env MOZ_X11_EGL=1 /home/oc/opt/firefox/firefox "$@"

This a common idiom for passing on to the next script/program whatever was
originally passed to this script.

BTW, why do you use "env"? Is that necessary, or is that just your general
practice?

FWIW, here are 3 alternatives that come to mind:

1) (Easiest) Just set MOZ_X11_EGL in your .profile/.login/.bashrc/whatever
2) Use an alias (tcsh/bash/etc) or function (sh/dash/bash/etc)
3) If you do do it as a script (as shown above), you might as well exec it:

MOZ_X11_EGL=1 exec /home/oc/opt/firefox/firefox "$@"

--
Christianity is not a religion.

- Rick C Hodgin -

Re: Shell script doesn't accept arguments (maybe OT?)

<u0gnvp$3c3o9$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6086&group=comp.unix.shell#6086

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: ottavio2...@yahoo.com (Ottavio Caruso)
Newsgroups: comp.unix.shell
Subject: Re: Shell script doesn't accept arguments (maybe OT?)
Date: Tue, 4 Apr 2023 08:43:36 +0000
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <u0gnvp$3c3o9$1@dont-email.me>
References: <u0erqc$30uas$1@dont-email.me> <u0es5r$p8s$1@freeq.furie.org.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 4 Apr 2023 08:43:37 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="083abc0f3dbe809433b262b33c84d623";
logging-data="3542793"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19lRtsqRdLUKTb3iOMaCEQOvBkwnE7r7h8="
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101
Firefox/102.0
Cancel-Lock: sha1:h9SOk8at4GB4EuFlXSS9gSDRozU=
Content-Language: en-GB
In-Reply-To: <u0es5r$p8s$1@freeq.furie.org.uk>
X-No-Archive: Yes
 by: Ottavio Caruso - Tue, 4 Apr 2023 08:43 UTC

Am 03/04/2023 um 15:42 schrieb Tom Furie:
> On 2023-04-03, Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
>> I have a rudimentary shell launcher:
>>
>> $ cat opt/bin/ff-accel
>> #!/bin/sh
>> env MOZ_X11_EGL=1 /home/oc/opt/firefox/firefox
>>
>> If I launch Firefox normally:
>>
>> $ /home/oc/opt/firefox/firefox www.google.com
>>
>> I get the Google homepage as expected.
>>
>> If I launch it this way:
>>
>> $ opt/bin/ff-accel www.google.com
>>
>> I just get a new instance of FF with a blank page.
>
> You're ignoring any arguments you pass to your script.
>
> Cheers,
> Tom

I know. I just realised that yesterday on my way home.

--
Ottavio Caruso

Re: Shell script doesn't accept arguments (maybe OT?)

<u0go77$3c3o9$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6087&group=comp.unix.shell#6087

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: ottavio2...@yahoo.com (Ottavio Caruso)
Newsgroups: comp.unix.shell
Subject: Re: Shell script doesn't accept arguments (maybe OT?)
Date: Tue, 4 Apr 2023 08:47:34 +0000
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <u0go77$3c3o9$2@dont-email.me>
References: <u0erqc$30uas$1@dont-email.me> <u0etgg$1tp3k$1@news.xmission.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 4 Apr 2023 08:47:35 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="083abc0f3dbe809433b262b33c84d623";
logging-data="3542793"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+KMCfC5N0TSyH9OIjGXOlVlogOYiyjGNQ="
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101
Firefox/102.0
Cancel-Lock: sha1:i54myY8te+DiwkvpKFimeF2hC2w=
In-Reply-To: <u0etgg$1tp3k$1@news.xmission.com>
X-No-Archive: Yes
Content-Language: en-GB
 by: Ottavio Caruso - Tue, 4 Apr 2023 08:47 UTC

Am 03/04/2023 um 16:05 schrieb Kenny McCormack:
> In article <u0erqc$30uas$1@dont-email.me>,
> Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
>> Hi,
>>
>> I'm trying to narrow this down to either my script or Firefox itself.
>>
>> I have a rudimentary shell launcher:
>>
>> $ cat opt/bin/ff-accel
>> #!/bin/sh
>> env MOZ_X11_EGL=1 /home/oc/opt/firefox/firefox
>
> This needs to be:
>
> env MOZ_X11_EGL=1 /home/oc/opt/firefox/firefox "$@"

Thanks. I just realised that yesterday night on my way home. But are the
quotes around $@ necessary?

> BTW, why do you use "env"? Is that necessary, or is that just your general
> practice?

I copied that from here:
https://wiki.debian.org/Firefox#Hardware_Video_Acceleration

Desktop shortcuts require "env" to work. Do shell scripts not require
"env" too?

--
Ottavio Caruso

Re: Shell script doesn't accept arguments (maybe OT?)

<u0gr7c$1uo8a$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6088&group=comp.unix.shell#6088

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.shell
Subject: Re: Shell script doesn't accept arguments (maybe OT?)
Date: Tue, 4 Apr 2023 09:38:52 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <u0gr7c$1uo8a$1@news.xmission.com>
References: <u0erqc$30uas$1@dont-email.me> <u0etgg$1tp3k$1@news.xmission.com> <u0go77$3c3o9$2@dont-email.me>
Injection-Date: Tue, 4 Apr 2023 09:38:52 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="2056458"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Tue, 4 Apr 2023 09:38 UTC

In article <u0go77$3c3o9$2@dont-email.me>,
Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
>Am 03/04/2023 um 16:05 schrieb Kenny McCormack:
>> In article <u0erqc$30uas$1@dont-email.me>,
>> Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
>>> Hi,
>>>
>>> I'm trying to narrow this down to either my script or Firefox itself.
>>>
>>> I have a rudimentary shell launcher:
>>>
>>> $ cat opt/bin/ff-accel
>>> #!/bin/sh
>>> env MOZ_X11_EGL=1 /home/oc/opt/firefox/firefox
>>
>> This needs to be:
>>
>> env MOZ_X11_EGL=1 /home/oc/opt/firefox/firefox "$@"
>
>Thanks. I just realised that yesterday night on my way home. But are the
>quotes around $@ necessary?

Yes, if any of any of the args have spaces in them. "$@" is the usual idiom
for this. Read more in "man bash" for the differences between $*, $@,
"$*", and "$@".

>> BTW, why do you use "env"? Is that necessary, or is that just your general
>> practice?
>
>I copied that from here:
>https://wiki.debian.org/Firefox#Hardware_Video_Acceleration
>
>Desktop shortcuts require "env" to work. Do shell scripts not require
>"env" too?

As is the case with such many things, it boils down to whether or not a
shell is involved. I'm assuming that "desktop shortcuts" don't invoke a
shell, so you have to use "env" to get some of the shell functionality.
You don't need it if you already have a shell involved (e.g., in a shell
script).

--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/Seriously

Re: Shell script doesn't accept arguments (maybe OT?)

<83ilebv364.fsf@helmutwaitzmann.news.arcor.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6089&group=comp.unix.shell#6089

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: nn.throt...@xoxy.net (Helmut Waitzmann)
Newsgroups: comp.unix.shell
Subject: Re: Shell script doesn't accept arguments (maybe OT?)
Date: Tue, 04 Apr 2023 21:49:07 +0200
Organization: A noiseless patient Spider
Lines: 66
Sender: Helmut Waitzmann <12f7e638@mail.de>
Message-ID: <83ilebv364.fsf@helmutwaitzmann.news.arcor.de>
References: <u0erqc$30uas$1@dont-email.me> <u0etgg$1tp3k$1@news.xmission.com>
<u0go77$3c3o9$2@dont-email.me>
Reply-To: Helmut Waitzmann Anti-Spam-Ticket.b.qc3c <oe.throttle@xoxy.net>, Helmut Waitzmann <12f7e638@mail.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
Injection-Info: dont-email.me; posting-host="1878a8240e9656fb5b745df2491165af";
logging-data="3733558"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19B89LdYIC3Os3em2E9m2M/juxhEWwpf+U="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)
Cancel-Lock: sha1:79JcOrrv8ZIINhnRuXe1Rs+Om8M=
sha1:1aA4yA7vwybCdJ8nQVfOQtfML2U=
Mail-Reply-To: Helmut Waitzmann Anti-Spam-Ticket.b.qc3c <oe.throttle@xoxy.net>, Helmut Waitzmann <12f7e638@mail.de>
Mail-Copies-To: nobody
 by: Helmut Waitzmann - Tue, 4 Apr 2023 19:49 UTC

Ottavio Caruso <ottavio2006-usenet2012@yahoo.com>:
> Am 03/04/2023 um 16:05 schrieb Kenny McCormack:
>> In article <u0erqc$30uas$1@dont-email.me>,
>> Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:

>>> I'm trying to narrow this down to either my script or Firefox
>>> itself.
>>>
>>> I have a rudimentary shell launcher:
>>>
>>>
>>> $ cat opt/bin/ff-accel
>>> #!/bin/sh
>>> env MOZ_X11_EGL=1 /home/oc/opt/firefox/firefox
>>
>> This needs to be:
>>
>> env MOZ_X11_EGL=1 /home/oc/opt/firefox/firefox "$@"
>
> Thanks. I just realised that yesterday night on my way home. But
> are the quotes around $@ necessary?

Yes, they are.  The POSIX standard
(<http://www.opengroup.org/onlinepubs/9699919799/mindex.html>)
describes in the volume about the shell command language and the
utilities (follow the "XCU" link,
<https://pubs.opengroup.org/onlinepubs/9699919799/utilities/toc.html>)
what it's going to happen if you don't use the quotes (follow the
"field splitting" link,
<https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_05>).

In short:  When not using the quotes, the values of the shell
parameter (in your use case: each of the positional parameters
("$@")) is split into parts at each character which is part of
the set of characters specified by the "IFS" shell variable. 
Depending on further conditions these parts are then matched
against filenames.  This is surely not what you want with your
script which should pass its positional parameters unmodified to
firefox.

=> Using quotes is the "normal way" of passing values of shell
parameters into commands.  (That it is the more complicated
expression than just leaving the quotes away might have its
origin in the historic development of the shell programming
language.)

>> BTW, why do you use "env"? Is that necessary, or is that just
>> your general practice?
>
> I copied that from here:
> https://wiki.debian.org/Firefox#Hardware_Video_Acceleration
>
> Desktop shortcuts require "env" to work. Do shell scripts not
> require "env" too?

The shell has got a built‐in mechanism of specifying environment
variables when invoking a simple command (in
<https://pubs.opengroup.org/onlinepubs/9699919799/utilities/toc.html>
follow the "simple commands" link
<https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01>)
which has got similar capabilities (not exactly the same) like
the «env» program:  To use it in a shell command line, just put
the environment assignments in front of the simple command.

Re: Shell script doesn't accept arguments (maybe OT?)

<u0i96r$3jdac$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6090&group=comp.unix.shell#6090

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: mortons...@gmail.com (Ed Morton)
Newsgroups: comp.unix.shell
Subject: Re: Shell script doesn't accept arguments (maybe OT?)
Date: Tue, 4 Apr 2023 17:43:39 -0500
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <u0i96r$3jdac$1@dont-email.me>
References: <u0erqc$30uas$1@dont-email.me> <u0etgg$1tp3k$1@news.xmission.com>
<u0go77$3c3o9$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 4 Apr 2023 22:43:39 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="07706c58e72dfe5c210491aa963eb01e";
logging-data="3781964"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19l8FWfiluCplk6qprOdKLF"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.9.1
Cancel-Lock: sha1:jUAdaZqcN6gg1JEATaSU9+SpTtg=
Content-Language: en-US
In-Reply-To: <u0go77$3c3o9$2@dont-email.me>
X-Antivirus: Avast (VPS 230404-6, 4/4/2023), Outbound message
X-Antivirus-Status: Clean
 by: Ed Morton - Tue, 4 Apr 2023 22:43 UTC

On 4/4/2023 3:47 AM, Ottavio Caruso wrote:
> Am 03/04/2023 um 16:05 schrieb Kenny McCormack:
>> In article <u0erqc$30uas$1@dont-email.me>,
>> Ottavio Caruso  <ottavio2006-usenet2012@yahoo.com> wrote:
>>> Hi,
>>>
>>> I'm trying to narrow this down to either my script or Firefox itself.
>>>
>>> I have a rudimentary shell launcher:
>>>
>>> $ cat opt/bin/ff-accel
>>> #!/bin/sh
>>> env MOZ_X11_EGL=1 /home/oc/opt/firefox/firefox
>>
>> This needs to be:
>>
>>      env MOZ_X11_EGL=1 /home/oc/opt/firefox/firefox "$@"
>
> Thanks. I just realised that yesterday night on my way home. But are the
> quotes around $@ necessary?

That's the wrong question. The right question would be "is it necessary
to remove the quotes?" because quotes in shell aren't something you add
when you need to, they're something you use by default and only remove
when you need to. If you think about quotes otherwise you'll end up
shooting yourself in the foot one day when you think you don't need
them. Think of quotes like the seatbelt in your car - you shouldn't wait
til you think you might have an accident to put it on. See
https://mywiki.wooledge.org/Quotes for more info.

Ed.

Re: Shell script doesn't accept arguments (maybe OT?)

<u0icua$3k2l6$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6091&group=comp.unix.shell#6091

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: Shell script doesn't accept arguments (maybe OT?)
Date: Wed, 5 Apr 2023 01:47:22 +0200
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <u0icua$3k2l6$1@dont-email.me>
References: <u0erqc$30uas$1@dont-email.me> <u0etgg$1tp3k$1@news.xmission.com>
<u0go77$3c3o9$2@dont-email.me> <u0i96r$3jdac$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 4 Apr 2023 23:47:22 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9ee48a9475d42c97844a00efe6558e3a";
logging-data="3803814"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/N7T3QcHil5Hz6Dk3SBA5h"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:31b2wPZn1N9jsifMpB/AIfydXaQ=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <u0i96r$3jdac$1@dont-email.me>
 by: Janis Papanagnou - Tue, 4 Apr 2023 23:47 UTC

On 05.04.2023 00:43, Ed Morton wrote:
> See https://mywiki.wooledge.org/Quotes for more info.

I wonder why that link lists

Backticks: `...` is the legacy command substitution syntax;

under "Quoting"; effectively it's no quoting and has (per se)
nothing to do with quoting (see also the POSIX reference).

And why it says

$"..." : This is a Bash extension.

(and not "a Ksh extension"); didn't Kornshell introduce that?

And why

$'...'

isn't declared as "extension" at all; isn't that a non-standard
(also Ksh-?) extension (that's as well borrowed by other shells)?

But otherwise the link provides some good information.

As a hint for the OP; if studying large texts behind links is
cumbersome I suggest to set the argument list to, say,

set a b "c d" e "f g h" i # here 6 arguments

and just inspect the output of

printf "'%s'\n" "$@"
printf "'%s'\n" "$*"
printf "'%s'\n" $@
printf "'%s'\n" $*

to quickly grasp to what these syntaxes will expand the data;
observe the number or arguments, its grouping, and preservation
of spaces.

Janis

Re: Shell script doesn't accept arguments (maybe OT?)

<33ac09dc-dad3-48cb-bb0c-955e12951ef6n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6096&group=comp.unix.shell#6096

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a05:620a:4447:b0:71f:b89c:5ac7 with SMTP id w7-20020a05620a444700b0071fb89c5ac7mr751364qkp.8.1680679133439;
Wed, 05 Apr 2023 00:18:53 -0700 (PDT)
X-Received: by 2002:a9d:6b94:0:b0:6a1:704d:aa08 with SMTP id
b20-20020a9d6b94000000b006a1704daa08mr1665845otq.0.1680679133130; Wed, 05 Apr
2023 00:18:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Wed, 5 Apr 2023 00:18:52 -0700 (PDT)
In-Reply-To: <u0icua$3k2l6$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:e82:d400:107f:a7d7:29c7:8889;
posting-account=rR5tnAoAAAC2kIBHWh0n6frMCTGowyvE
NNTP-Posting-Host: 2600:1700:e82:d400:107f:a7d7:29c7:8889
References: <u0erqc$30uas$1@dont-email.me> <u0etgg$1tp3k$1@news.xmission.com>
<u0go77$3c3o9$2@dont-email.me> <u0i96r$3jdac$1@dont-email.me> <u0icua$3k2l6$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <33ac09dc-dad3-48cb-bb0c-955e12951ef6n@googlegroups.com>
Subject: Re: Shell script doesn't accept arguments (maybe OT?)
From: jalen...@gmail.com (Jalen Q)
Injection-Date: Wed, 05 Apr 2023 07:18:53 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2684
 by: Jalen Q - Wed, 5 Apr 2023 07:18 UTC

On Tuesday, April 4, 2023 at 6:47:27 PM UTC-5, Janis Papanagnou wrote:
> On 05.04.2023 00:43, Ed Morton wrote:
> > See https://mywiki.wooledge.org/Quotes for more info.
> I wonder why that link lists
>
> Backticks: `...` is the legacy command substitution syntax;
>
> under "Quoting"; effectively it's no quoting and has (per se)
> nothing to do with quoting (see also the POSIX reference).
>
> And why it says
>
> $"..." : This is a Bash extension.
>
> (and not "a Ksh extension"); didn't Kornshell introduce that?
>
> And why
>
> $'...'
>
> isn't declared as "extension" at all; isn't that a non-standard
> (also Ksh-?) extension (that's as well borrowed by other shells)?
>
> But otherwise the link provides some good information.
>
>
> As a hint for the OP; if studying large texts behind links is
> cumbersome I suggest to set the argument list to, say,
>
> set a b "c d" e "f g h" i # here 6 arguments
>
> and just inspect the output of
>
> printf "'%s'\n" "$@"
> printf "'%s'\n" "$*"
> printf "'%s'\n" $@
> printf "'%s'\n" $*
>
> to quickly grasp to what these syntaxes will expand the data;
> observe the number or arguments, its grouping, and preservation
> of spaces.
>
> Janis
ddddvvvddvvd

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor