Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
cat? grep? file outputs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Godsmacker777
Apprentice
Apprentice


Joined: 04 May 2004
Posts: 205
Location: Fenway area, Boston Massachusetts :O)

PostPosted: Tue Dec 07, 2004 4:07 pm    Post subject: cat? grep? file outputs Reply with quote

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
View user's profile Send private message
flazz
Guru
Guru


Joined: 22 Nov 2003
Posts: 496
Location: Florida

PostPosted: Tue Dec 07, 2004 4:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
Godsmacker777
Apprentice
Apprentice


Joined: 04 May 2004
Posts: 205
Location: Fenway area, Boston Massachusetts :O)

PostPosted: Tue Dec 07, 2004 4:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
flazz
Guru
Guru


Joined: 22 Nov 2003
Posts: 496
Location: Florida

PostPosted: Tue Dec 07, 2004 4:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
Godsmacker777
Apprentice
Apprentice


Joined: 04 May 2004
Posts: 205
Location: Fenway area, Boston Massachusetts :O)

PostPosted: Tue Dec 07, 2004 4:47 pm    Post subject: Reply with quote

thanks~

I'll take a look at that. I like knowing ways to do things, it helps when you need to improvise :oD
_________________
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
View user's profile Send private message
Doctor
n00b
n00b


Joined: 11 Feb 2003
Posts: 26

PostPosted: Wed Dec 08, 2004 8:32 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum