Liste des Groupes | Revenir à cu shell |
Kaz Kylheku <643-408-1753@kylheku.com> writes:
[...]The obvious situation is double quotes. Inside double quotes, parameter[...]
expansion happens, but not tilde expansion (not to mention pathname
expansion (globbing) and perhaps some other things).
>
So this won't work:
>
PATH="$PATH:~/bin"
>Sorry I don't have details, but it is true nonetheless.>
There they are.
In fact it probably will *partially* work. As I mentioned elsethread,
bash expands a leading ~ (or even ~username) in an element of $PATH when
executing a command.
But if you run a program from the command line that invokes another
program (say, a C program that calls system()), it won't treat that
element of $PATH the same way.
For this and other reasons, though you *can* have a literal ~ in $PATH
in bash, it's best to avoid it and use $HOME instead.
A literal '$HOME'
won't work at all, but that's less likely to be a problem if your at all
aware of how double quotes work in the shell.
I suggest that bash's undocumented behavior is less than helpful.
I'll probably submit a bug report.
Les messages affichés proviennent d'usenet.