View Full Version : printing the username
ignoranceisblis
03-14-2005, 06:37 PM
I'm trying to right a script that reference a file in the users home dir
I need to be able to go
perl script.pl
and the script should print
/home/elliot
basically I'm just asking how to represent the $HOME dir of the user running the script
T.I.A.
mlseim
03-14-2005, 08:05 PM
I'm not quite following the question ...
You want the home directory of the server where
the script is stored?
or
You want the home directory of where the
script was called from ... from another website?
or
You want to know which site the script was
referrered from, like a stats counter?
-------------
Who exactly is the "user" ... the person that is running the script,
or the server that is running the script?
ignoranceisblis
03-14-2005, 08:28 PM
this script it run at the bash prompt, it is never viewed in the browser
the input/output should look like this
elliot@chair:~$ perl script.pl
/home/elliot
I can make a simple bash script to do it
#!/bin/bash
print $HOME
that would accomplish the same thing, but I was wondering if there is a perl way of accomplising this
mlseim
03-14-2005, 09:27 PM
sorry, I don't know the answer to that.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.