Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Linux Operating System > Linux Talk
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-26-2005, 06:17 PM   #1 (permalink)
sarg
Junior Member
 
Join Date: Jul 2005
Posts: 14
Default Finding full path on a Linux server

Hello,
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

TIA
sarg is offline   Reply With Quote
Sponsored Links
Old 07-26-2005, 06:38 PM   #2 (permalink)
sandman
Junior Member
 
Join Date: Jul 2005
Posts: 34
Default

The path to you script is held in the environment variable SCRIPT_FILENAME. Here is a short script that will display all the variables. You can save the code as enpath.pl and put it in your cgi-bin, this is how you call it. From your browser type: http://www.yourdomain.com/cgi-bin/enpath.pl

PHP 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

This should help you get the correct path..
sandman is offline   Reply With Quote
Old 08-30-2005, 08:00 PM   #3 (permalink)
vvaldir
Junior Member
 
Join Date: Jul 2005
Posts: 18
Default

Hey that's cool ~sandman. I forgot to chmod on the file, but after that it runs fine for me.
vvaldir is offline   Reply With Quote
Old 09-11-2005, 10:03 AM   #4 (permalink)
grax_88
Junior Member
 
Join Date: Sep 2005
Posts: 2
Default

If you are trying find a file location you can just type in locate filename.abc and it will show you where it is
grax_88 is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 01:22 AM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums