Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Get home dir from shell

by kennethk (Monsignor)
on Apr 03, 2013 at 16:39 UTC ( #1026878=note: print w/ replies, xml ) Need Help??


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

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


Comment on Re^3: Get home dir from shell
Download Code
Re^4: Get home dir from shell
by hdb (Parson) on Apr 04, 2013 at 06:36 UTC

    Two more:

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1026878]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2014-07-10 00:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (197 votes), past polls