LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 07-07-2007, 12:41 PM   #1
7stud
LQ Newbie
 
Registered: Feb 2007
Posts: 22

Rep: Reputation: 15
screwed up adding to $PATH--cmds don't work


Hi,

I tried adding to my PATH environment variable in ~/.bash_profile, and I screwed something up, and now no commands, like ls, vi, etc., work anymore. I need to get back into ~/.bash_profile and fix it, but I can't figure out how to open ~/.bash_profile to edit it. I usually edit with vi. I'm on max os 10.4.7.
 
Old 07-07-2007, 12:59 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Try doing what the shell does: look for the executable in a specific ordered list. I suggest you start with this list:

/bin/
/usr/bin/
/usr/local/bin/

Try running whatever program you want by prefixing it with one of these directories:

eg. /bin/vi

If you still don't understand how you messed up your bash startup scripts once you've gotten into them, post them here (use [ C O D E ] tags please).

--- rod.
 
Old 07-07-2007, 01:36 PM   #3
7stud
LQ Newbie
 
Registered: Feb 2007
Posts: 22

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by theNbomr
Try doing what the shell does: look for the executable in a specific ordered list. I suggest you start with this list:

/bin/
/usr/bin/
/usr/local/bin/

Try running whatever program you want by prefixing it with one of these directories:

eg. /bin/vi

If you still don't understand how you messed up your bash startup scripts once you've gotten into them, post them here (use [ C O D E ] tags please).

--- rod.
Thanks! /usr/bin/vi ~/.bash_profile worked. I mistyped a character in my .bash_profile file, and that is what was causing me the problems.

I have another question: what's the difference between using $PATH and ${PATH}?

Last edited by 7stud; 07-07-2007 at 01:58 PM.
 
Old 07-07-2007, 01:47 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
I have another question: what's the difference between using $PATH and ${PATH}?
Semantically, nothing. The curly braces are used to disambiguate the name of the variable in certain circumstances, such as when a variable needs to be interpolated and concatenated at the same time:

For instance:
Code:
DIR="/bin/"
# can't write $DIRvi...
echo ${DIR}vi
--- rod

Last edited by theNbomr; 07-07-2007 at 01:48 PM.
 
Old 07-07-2007, 06:14 PM   #5
7stud
LQ Newbie
 
Registered: Feb 2007
Posts: 22

Original Poster
Rep: Reputation: 15
Thanks.
,,,
....
 
  


Reply



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
export Path=/usr/java:$Path does not seem to work lumix Linux - Newbie 1 03-19-2007 03:11 PM
I really screwed things up, Need help with reseting path. M$ISBS Slackware 9 12-14-2006 07:04 AM
Want2use /sbin cmds undr non-root account w/o sudo. Is it safe 2 add /sbin 2 my PATH? kornerr Linux - General 4 02-25-2005 09:29 AM
why is my PATH variable screwed up? apberzerk Linux - General 2 11-07-2003 11:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:36 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