[TriLUG] Changing slashes to backslashes in prompt

Mike Viscount via TriLUG trilug at trilug.org
Fri Apr 19 18:07:39 EDT 2019


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

You are correct and thanks ... even I'm learning from this stupid exercise
... LOL

I use the ${} syntax often as it's good practice and often quotes also to
prevent weird things from happening ... but as far as needing to be upper
case inside them - don't think so ... just any variable and they can be
upper, lower, mixed, ... etc.

Thanks much for the () vs. `` - need to modernize myself!


On Fri, Apr 19, 2019 at 6:00 PM Aaron Schrab <aaron at schrab.com> wrote:

> 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.
>


More information about the TriLUG mailing list