in reply to Re: Get home dir from shell
in thread Get home dir from shell

It will print $HOME

Replies are listed 'Best First'.
Re^3: Get home dir from shell
by Your Mother (Archbishop) on Apr 03, 2013 at 15:43 UTC
    moo@cow>perl -e 'print `echo \$HOME`' /home/moo
Re^3: Get home dir from shell
by kennethk (Abbot) on Apr 03, 2013 at 16:39 UTC
    ~$ perl -e 'print `echo $HOME`' ~$ perl -e 'print `echo \$HOME`' /home/kennethk ~$ perl -e 'print `echo \\$HOME`' \ ~$ perl -e 'print `echo \\\$HOME`' $HOME ~$ perl -e '$q = chr 39; print `echo $q\$HOME$q`' $HOME ~$ perl -e '$loc = q{\$HOME}; print `echo $loc`' $HOME
    Try outputting your command to make sure it's what you think it is.

    #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

      Two more:

      c:\>perl -e "print `echo \%HOME\%` " c:\brocmi c:\>perl -e "print `echo %HOME%` " crocmi