[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: echo builtin doesn't handle end-of-options flag

From: Eric Cook
Subject: Re: echo builtin doesn't handle end-of-options flag
Date: Sun, 16 Aug 2020 12:14:23 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

On 8/16/20 11:47 AM, Todd A. Jacobs wrote:
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: darwin19.5.0
Compiler: clang
Compilation CFLAGS: -DSSH_SOURCE_BASHRC -Wno-parentheses -Wno-format-security
uname output: Darwin titan.local 19.6.0 Darwin Kernel Version 19.6.0: Thu Jun 
18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64
Machine Type: x86_64-apple-darwin19.5.0

Bash Version: 5.0
Patch Level: 18
Release Status: release

         The echo builtin accepts options, but does not seem to handle
         `--` correctly as the end of options. The expected behavior
         would be for -- to be removed, and any following flag-like
         substrings printed as-is.

         echo "-n"         # "" but expecting "-n"
         echo -- -n foo    # -- -n foo
         echo -- "-n foo"  # -- -n foo

This is an intentional relic of the past, you really should use printf.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]