Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Janis Papanagnou Newsgroups: comp.unix.shell Subject: [ksh] Warning: pipe symbol within ${} should be quoted? Date: Thu, 8 May 2025 01:00:40 +0200 Organization: A noiseless patient Spider Lines: 23 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Date: Thu, 08 May 2025 01:00:42 +0200 (CEST) Injection-Info: dont-email.me; posting-host="68c32824e17de1f129cf89596dd3462d"; logging-data="1380203"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+N7NbDP7JSNyX5p+BDNvhL" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cancel-Lock: sha1:vEC2K/QWfqKF51hNeeYHhYj5OZM= X-Mozilla-News-Host: news://news.eternal-september.org:119 X-Enigmail-Draft-Status: N1110 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