Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding the full path to my space on a Linux server? 1

Status
Not open for further replies.

CraigHappy

Technical User
Jun 1, 2005
92
GB
Hi

I've been messing around with a perl script and it asks for the full path.
Can anyone tell me a way of finding this out?
I know with one the remote hosted windows server running asp we use, we uploaded a page with a little sctipt which gave us the info.
Not sure about this Remote hosted Linux server though?

Here's an example of what the script is asking for -

/usr/lib/httpd/hosts/OWNDOMAIN/htdocs/logs/referrer

Many thanks

Happy.
 
The path to you script is held in the environment variable SCRIPT_FILENAME. Here is a short script that will display all the variables. Assuming you save the code as envars.pl and put it in your cgi-bin, this is how you call it. From your browser type:
Code:
#!/usr/bin/perl

use CGI;

$co = new CGI;

print
    $co->header,
    $co->start_html('CGI Environment Variables Example'),
    $co->center($co->h1('CGI Evironment Variables Example'));

foreach $key (sort keys %ENV) {

    print $co->b("$key=>$ENV{$key}"),
    $co->br;
}

print $co->end-html;
 
Hi RhythmAce

Many thanks for that, it did the job a treat!

Thank you.

Happy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top