[TriLUG] Changing slashes to backslashes in prompt

Aaron Schrab via TriLUG trilug at trilug.org
Fri Apr 19 18:00:57 EDT 2019


At 17:49 -0400 19 Apr 2019, Mike Viscount via TriLUG <trilug at trilug.org> wrote:
>I don't think there's an environment variable "pwd" but there is a 
>command
>(builtin) pwd:
>
>mviscount at eruleadm:~> pwd
>/home/mviscount
>
>and you could get the output from that command into your echo statement by
>using single back ticks ...
>
>mviscount at eruleadm:~> echo `pwd`
>/home/mviscount
>
>but from your syntax I suspect you're looking for the environment variable
>"PWD" .... note that it's upper case and that matters in *nix.

No, the $() syntax is the more modern version of back ticks, and is 
generally preferred these days since they nest better.

You're likely thinking of ${PWD} using curly braces rather than 
parentheses. That would require that the contents be a variable, and 
generally need that to be in all upper case.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 549 bytes
Desc: not available
URL: <http://www.trilug.org/pipermail/trilug/attachments/20190419/b803ed1e/attachment.pgp>


More information about the TriLUG mailing list