LinuxQuestions.org
Review your favorite Linux distribution.
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 10-30-2010, 01:08 PM   #1
ajhunter
LQ Newbie
 
Registered: Oct 2010
Posts: 8

Rep: Reputation: 0
Question $PATH modifications


How do I use "push/unshift" to add a directory path to $PATH (this makes a permanent entry, not an entry for the current session). I have used this method before, but I can't remember the correct syntax.
 
Old 10-30-2010, 01:29 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
It might be something like:
$PATH=$PATH:$(push/unshift)
export $PATH
 
1 members found this post helpful.
Old 10-30-2010, 01:33 PM   #3
udaman
Member
 
Registered: Oct 2010
Location: New England, USA
Distribution: OpenSUSE/Slackware64/RHEL/Mythbuntu
Posts: 189

Rep: Reputation: 39
You haven't mentioned which distro you're using.

In some distros edit ~/.profile and change this line:

PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin:/root/bin
 
Old 10-30-2010, 02:51 PM   #4
ajhunter
LQ Newbie
 
Registered: Oct 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Exclamation re: $PATH Modification

The distro I'm using is FC13. For bigrigdriver, your reply looks familiar but EXPORT was not used. It was just a one-line entry.
 
Old 10-30-2010, 04:25 PM   #5
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Oops! My bad. I should have also said that the command could be given as:
export $PATH=$PATH:$(push/unshift)

Note that is given in one line.
 
1 members found this post helpful.
Old 10-30-2010, 06:35 PM   #6
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
If I may... I don't think we're all on the same page. I say that because the bash shell does not have a command or built-in named push nor unshift. Perl does have both of those commands.

So, I think ajhunter wants a one-liner Perl script--even though it was not specified in the original post. I don't care for Perl. So I can't help beyond giving this link: Perl's env module documentation. Read it and look at the short examples.

Even so, following the examples given on that page will not make the changes permanent. As udaman said, the appropriate entry in ~/.profile (or any other appropriate startup file for your shell) will need to be made/updated.
 
1 members found this post helpful.
  


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
Modifications in Makefile - - any pointers!! sahil.jammu Linux - Newbie 4 07-31-2009 12:26 PM
makefiles and modifications disruptive Programming 1 04-26-2008 08:05 PM
Synaptic modifications htnakirs Linux - Software 1 03-29-2008 05:07 AM
Ubuntu Livecd Modifications kd2323 Linux - General 5 01-08-2008 01:00 PM
grafburn modifications. gandhul Grafpup 6 07-03-2007 12:35 PM

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

All times are GMT -5. The time now is 02:39 AM.

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