Slackware This Forum is for the discussion of Slackware Linux.
|
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-03-2006, 11:37 PM
|
#1
|
|
Senior Member
Registered: Sep 2004
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,043
Rep:
|
set path with output from text file.
What I am trying to accomplish is to set my $PATH variable with a information from a text file. What I have done was first create the text file by doing the following.
Code:
echo $PATH >> path.txt
I then edited the path file. Now I need to set the Path variable with the new information in there. Any insights would help.
|
|
|
|
12-04-2006, 12:34 AM
|
#2
|
|
Member
Registered: Oct 2005
Location: China
Distribution: ArchLinux
Posts: 103
Rep:
|
export a new path
Code:
$ export PATH="your path"
, or add path to old $PATH
Code:
$ export PATH="your path:$PATH"
|
|
|
|
12-04-2006, 02:02 AM
|
#3
|
|
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,592
|
Set the path to only what's in the file this way:
PATH=`cat path.txt`
This will place the path in file before your regular path:
PATH=`cat path.txt`:$PATH
This will append the path in file to your regular path
PATH=$PATH:`cat path.txt`
If needed:
export PATH
On another note, that's pretty crappy code in your signature. I couldn't get it to compile, so I rewrote it in assembler, but get errors like this:
Compiling failed, no gas found.
Last edited by gnashley; 12-04-2006 at 02:12 AM.
|
|
|
|
12-04-2006, 12:49 PM
|
#4
|
|
Senior Member
Registered: Sep 2004
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,043
Original Poster
Rep:
|
Quote:
|
Originally Posted by gnashley
Set the path to only what's in the file this way:
PATH=`cat path.txt`
This will place the path in file before your regular path:
PATH=`cat path.txt`:$PATH
This will append the path in file to your regular path
PATH=$PATH:`cat path.txt`
If needed:
export PATH
On another note, that's pretty crappy code in your signature. I couldn't get it to compile, so I rewrote it in assembler, but get errors like this:
Compiling failed, no gas found.
|
Thanks that is what I was looking for. And the code it is a work in progress. That probably why the shitty ideas have been forming lately. 
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:38 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|