LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   server variables in bash scripting (https://www.linuxquestions.org/questions/linux-newbie-8/server-variables-in-bash-scripting-311915/)

basher400 04-11-2005 04:15 AM

server variables in bash scripting
 
are they any server variables in bash/SSH scripting as is in PHP or Perl, for example in PHP:
$_SERVER['DOCUMENT_ROOT'] or $_SERVER['HTTP_HOST']

I'm trying to retrieve the absolute path of an .SH script I'm running





thank you

basher400 04-11-2005 06:17 AM

is what i'm asking that stupid?

bigearsbilly 04-11-2005 06:26 AM

the running script is $0

man bash
;)

basher400 04-11-2005 06:52 AM

Quote:

Originally posted by bigearsbilly
the running script is $0

man bash
;)

thanks but i see $0 only prints out the filename, what i need is the full path

bigearsbilly 04-11-2005 07:04 AM

try which $0


All times are GMT -5. The time now is 02:40 PM.