[ksh] Warning: pipe symbol within ${} should be quoted?

Liste des GroupesRevenir à cu shell 
Sujet : [ksh] Warning: pipe symbol within ${} should be quoted?
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.unix.shell
Date : 08. May 2025, 00:00:40
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vvgomq$1a3rb$1@dont-email.me>
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
With syntax-check ('ksh -n') I get a warning in Ksh for this expression

  "${pipe#* | }"

concerning the pipe symbol. (Bash and Zsh don't complain.)

(2709)$ ksh -n -c '"${pipe#* | }"'
ksh: warning: line 1: | within ${} should be quoted
(2710)$ ksh -n -c '"${pipe#* [|] }"'
ksh: warning: line 1: | within ${} should be quoted
(2711)$ ksh -n -c '"${pipe#* \| }"'

(2712)$ bash -n -c '"${pipe#* | }"'
(2713)$ bash -n -c '"${pipe#* [|] }"'
(2714)$ bash -n -c '"${pipe#* \| }"'

(2715)$ zsh -n -c '"${pipe#* | }"'
(2716)$ zsh -n -c '"${pipe#* [|] }"'
(2717)$ zsh -n -c '"${pipe#* \| }"'

Just a bug, or is ksh too sensible here, or some potential subtle issue?

Janis

Date Sujet#  Auteur
8 May 25 * [ksh] Warning: pipe symbol within ${} should be quoted?4Janis Papanagnou
30 May20:52 `* Re: [ksh] Warning: pipe symbol within ${} should be quoted?3Martijn Dekker
30 May23:30  `* Re: [ksh] Warning: pipe symbol within ${} should be quoted?2Janis Papanagnou
31 May20:15   `- Re: [ksh] Warning: pipe symbol within ${} should be quoted?1Eric Pozharski

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal