LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 12-03-2006, 11:37 PM   #1
jstephens84
Senior Member
 
Registered: Sep 2004
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,054

Rep: Reputation: 83
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.
 
Old 12-04-2006, 12:34 AM   #2
naihe2010
Member
 
Registered: Oct 2005
Location: China
Distribution: ArchLinux
Posts: 103

Rep: Reputation: 15
export a new path
Code:
$ export PATH="your path"
, or add path to old $PATH
Code:
$ export PATH="your path:$PATH"
 
Old 12-04-2006, 02:02 AM   #3
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,755

Rep: Reputation: 466Reputation: 466Reputation: 466Reputation: 466Reputation: 466
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.
 
Old 12-04-2006, 12:49 PM   #4
jstephens84
Senior Member
 
Registered: Sep 2004
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,054

Original Poster
Rep: Reputation: 83
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.
 
  


Reply


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
command output to text file? meniscus Linux - Newbie 4 10-05-2006 05:29 AM
using commands to output path, filename and info to a txt file bob_man_uk Linux - General 3 05-11-2006 02:31 PM
how to enumerate first line of text file to standard output? zero79 Linux - General 1 07-07-2004 06:37 PM
pipe output to append to a text file davee Linux - Newbie 3 08-27-2003 05:03 AM
Piping output to a text file joadoor Linux - Newbie 7 04-19-2002 03:50 AM


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