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

    From Janis Papanagnou@21:1/5 to All on Thu May 8 01:00:40 2025
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)