LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-12-2011, 10:26 PM   #16
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67

Quote:
Originally Posted by rkelsen View Post
If you use the CLI long enough, you will find the need for absolute addressing.
I totally agree. Say I'm working on a system which has a perl script sitting in some folder which is in the path. Say this system also has "." in the path. Now I decided to copy that perl script into my home directory to add some feature to it. If I just type blah.pl while I'm sitting in my home directory which one am I running? In situations where the answer might be ambiguous (based on the order of the PATH in this case) using the absolute reference of ./blah.pl makes sense.
 
1 members found this post helpful.
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 03-16-2011, 09:59 AM   #17
Peverel
Member
 
Registered: May 2009
Location: Chelmsford, England
Distribution: OpenSuse 12.2 and 13.2, Leap 4.2
Posts: 128

Rep: Reputation: 24
As far as I know, the only use of ./ is in running an executable from the current directory. If I want to copy a file, I type something like:

cp fred jim

If I want to test a new variant called cp in my current directory, I type:

./cp fred jim

If . were included in PATH, then

cp fred jim

would run the local code, not the system command. This gives an interesting opportunity for hackers for installation of malicious code.
 
1 members found this post helpful.
Old 03-16-2011, 11:15 AM   #18
Telengard
Member
 
Registered: Apr 2007
Location: USA
Distribution: Kubuntu 8.04
Posts: 579
Blog Entries: 8

Rep: Reputation: 148Reputation: 148
Quote:
Originally Posted by Peverel View Post
If . were included in PATH, then

cp fred jim

would run the local code, not the system command. This gives an interesting opportunity for hackers for installation of malicious code.
I wonder whether or not that is the reason . is not included in $PATH by default.
 
  


Reply

Tags
command line, directory, path



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] A confusing statement about "locking an account" in the ClamAV documentation. pr_deltoid Linux - Software 3 06-24-2010 04:09 AM
LXer: Dell removes "Ubuntu is safer than Microsoft® Windows® " statement from website LXer Syndicated Linux News 0 06-17-2010 08:00 PM
LXer: Dell removes "Ubuntu is safer than Microsoft® Windows® " statement from website LXer Syndicated Linux News 0 06-17-2010 03:20 PM
XLF compile HELP !The unformatted I/O statement on the file "..." cannot be completed chonchis AIX 0 06-12-2009 01:22 PM
LXer: Position Statement to the Dunc-Tanc "experiment" LXer Syndicated Linux News 0 10-27-2006 01:03 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration