LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 04-26-2011, 09:22 AM   #1
Donldh
LQ Newbie
 
Registered: Apr 2011
Posts: 1

Rep: Reputation: 0
Deleted path variable how to return


Experimenting with shell variables, accidentally deleted the path variable how could I return to the original path value. What kinds of problems will I have if I don't have a path variable.
 
Old 04-26-2011, 09:31 AM   #2
reed9
Member
 
Registered: Jan 2009
Location: Boston, MA
Distribution: Arch Linux
Posts: 653

Rep: Reputation: 141Reputation: 141
Edit /etc/profile

Put in something like
Code:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
export PATH
Some distros do not include /usr/sbin or /sbin in the default $PATH, but it's not necessarily a problem to do so.

If you don't have a PATH variable, the shell doesn't know where to look for commands.
http://www.cs.purdue.edu/homes/cs348/unix_path.html
 
1 members found this post helpful.
Old 04-26-2011, 09:36 AM   #3
sibe
Member
 
Registered: Apr 2011
Location: Jakarta, Indonesia
Distribution: Fedora, CentOS
Posts: 122

Rep: Reputation: 21
Hi,

if you don't have $PATH in your env variable, the shell won't be able to find the exact location of any command you enter at the command prompt.

To get a lost $PATH var, you can simply copy another user's $PATH to your ~/.bash_profile, assuming you use bash shell.
 
Old 04-26-2011, 09:50 AM   #4
Telengard
Member
 
Registered: Apr 2007
Location: USA
Distribution: Kubuntu 8.04
Posts: 579
Blog Entries: 8

Rep: Reputation: 147Reputation: 147
Did you do something like this?

Code:
$ PATH=
$
If so then don't worry. PATH should be automatically restored the next time you login.
 
1 members found this post helpful.
  


Reply

Tags
path


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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] Evolution e-mail: return to Inbox after message deleted Steve W Linux - Software 4 12-16-2010 05:16 AM
Add path to $PATH variable alaios Suse/Novell 2 04-19-2009 08:41 AM
bash script path issue - how to pass a path as a string to a variable PiNPOiNT Programming 5 04-17-2009 05:48 PM
can thread return a local variable? iclinux Programming 1 01-13-2005 11:37 PM
Sendmail return path dj_relentless Linux - General 2 06-07-2002 06:40 AM


All times are GMT -5. The time now is 05:17 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration