View previous topic :: View next topic |
Author |
Message |
Godsmacker777 Apprentice
Joined: 04 May 2004 Posts: 205 Location: Fenway area, Boston Massachusetts :O)
|
Posted: Tue Dec 07, 2004 4:07 pm Post subject: cat? grep? file outputs |
|
|
I would like to use my USE variable backup file: use.flags to add a line to make.conf
Would I use cat? or grep? I couldn't seem to find the info myself, but I know it's rather simple.
The cat seems to have my tongue. _________________ Why must we hear what system you're running gentoo on, especially if all you've got is a measly gig of ram or 3gHz processor?
I want to see signatures boasting 25 cpu clusters and blade severs, or a big 'ole onyx..anyone running gentoo on an onxy?? |
|
Back to top |
|
|
flazz Guru
Joined: 22 Nov 2003 Posts: 496 Location: Florida
|
Posted: Tue Dec 07, 2004 4:30 pm Post subject: |
|
|
what is it exactly you want to do?
to append characters to a file use anything that can output to stdout with the >> operator
examples: Code: |
echo "net-www/mozilla-firefox ~x86" >> /etc/portage/package.keywords
grep -i 'xorg' /etc/portage/* >> ./xorg_results
cat new_key >> .ssh/known_hosts
|
|
|
Back to top |
|
|
Godsmacker777 Apprentice
Joined: 04 May 2004 Posts: 205 Location: Fenway area, Boston Massachusetts :O)
|
Posted: Tue Dec 07, 2004 4:33 pm Post subject: |
|
|
I tried cat /home/jason/use.flags >> /etc/make.copy
which worked fine.
For future reference, how would I use the output of one text file, and add it to a specific line, (or after a specific set of characters, say USE=), in another text file?
~thanks _________________ Why must we hear what system you're running gentoo on, especially if all you've got is a measly gig of ram or 3gHz processor?
I want to see signatures boasting 25 cpu clusters and blade severs, or a big 'ole onyx..anyone running gentoo on an onxy?? |
|
Back to top |
|
|
flazz Guru
Joined: 22 Nov 2003 Posts: 496 Location: Florida
|
Posted: Tue Dec 07, 2004 4:41 pm Post subject: |
|
|
that is some heavy text manipulation, but if all you want to do us maintain use flags, try the program euse, its in app-portage/gentoolkit |
|
Back to top |
|
|
Godsmacker777 Apprentice
Joined: 04 May 2004 Posts: 205 Location: Fenway area, Boston Massachusetts :O)
|
Posted: Tue Dec 07, 2004 4:47 pm Post subject: |
|
|
thanks~
I'll take a look at that. I like knowing ways to do things, it helps when you need to improvise D _________________ Why must we hear what system you're running gentoo on, especially if all you've got is a measly gig of ram or 3gHz processor?
I want to see signatures boasting 25 cpu clusters and blade severs, or a big 'ole onyx..anyone running gentoo on an onxy?? |
|
Back to top |
|
|
Doctor n00b
Joined: 11 Feb 2003 Posts: 26
|
Posted: Wed Dec 08, 2004 8:32 am Post subject: |
|
|
Something like:
echo USE=`cat file`" >> make.conf
could also probably use sed to switch the new use line with the old one if you wanted to. |
|
Back to top |
|
|
|