On Wed, Feb 12, 2025, at 10:50 AM, Andrés Rodríguez Reina wrote:
>         In my opinion, it would be useful to have a warning be issued 
> when in interactive mode, when at the current working directory a 
> file/folder named '~' exists, and a command with a parameter starting 
> with ~ is used (which will produce tilde expansion).

You could say this about any unexpanded word.

        touch '$var'
        echo $var

        touch '*'
        ls *

        set -H
        touch '!$'
        stat !$

Should the shell look for a directory entry for every word before
it does anything?


> Fix:
>         When in interactive mode and when a suitable flag is activated, 
> an error should appear. For example:
>         <Error: use of ~ is ambiguous. Please either specify '~' or 
> type the home path to avoid ambiguity.>

Tilde expansion may surprise inexperienced users, but there's nothing
"ambiguous" about it.  It is well defined.


-- 
vq

  • [S... Andrés Rodríguez Reina
    • ... Lawrence Velázquez
      • ... Andrés Rodríguez Reina
        • ... Lawrence Velázquez
    • ... microsuxx
      • ... microsuxx
        • ... Andrés Rodríguez Reina via Bug reports for the GNU Bourne Again SHell
    • ... Dale R. Worley
    • ... Chet Ramey

Reply via email to