Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[risolto]Scrematura output shell
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
soulfire
n00b
n00b


Joined: 09 Apr 2004
Posts: 70
Location: Italy

PostPosted: Thu May 19, 2005 8:46 pm    Post subject: [risolto]Scrematura output shell Reply with quote

salve,
volevo farvi presente un problema cui sono andato incontro in questi giorni e a cui non ho trovato soluzione.

quello che vorrei fare è trovare un modo di "scremare" l'output di un comando e lasciare solo quello che mi serve.

ad esempio

Code:
emerge -epv kdebase-meta | grep "arts*"
[ebuild  N    ] kde-base/kpersonalizer-3.4.0  -arts* -debug -java -kdeenablefinal -kdexdeltas -xinerama 0 kB
[ebuild  N    ] kde-base/kdebase-startkde-3.4.0-r1  -arts* -debug -java -kdeenablefinal -kdexdeltas -xinerama 0 kB
[ebuild  N    ] kde-base/drkonqi-3.4.0  -arts* -debug -java -kdeenablefinal -kdexdeltas -xinerama 0 kB
[ebuild  N    ] kde-base/konqueror-3.4.0  -arts* -debug -java -kdeenablefinal -kdexdeltas -xinerama 0 kB
[ebuild  N    ] kde-base/konsole-3.4.0  -arts* -debug -java -kdeenablefinal -kdexdeltas -xinerama 0 kB


ora, io vorrei riemergere questi pacchetti. c'è un modo per rimuovere da questo output la parte [ebuild N ] e le successive useflag e lasciare solo il nome, in modo da poter mettere direttamente tutto come argomento di emerge senza costringermi a copiare ogni singola voce a mano ?

grazie :D


Last edited by soulfire on Thu May 19, 2005 9:22 pm; edited 1 time in total
Back to top
View user's profile Send private message
fabius
Guru
Guru


Joined: 29 Nov 2004
Posts: 525

PostPosted: Thu May 19, 2005 8:54 pm    Post subject: Reply with quote

puoi usare cut o awk ad esempio
Back to top
View user's profile Send private message
soulfire
n00b
n00b


Joined: 09 Apr 2004
Posts: 70
Location: Italy

PostPosted: Thu May 19, 2005 9:07 pm    Post subject: Reply with quote

grazie !

effettivamente la cosa era molto semplice, solo che non avevo idea dell'esistenza di awk o cut :oops: :oops: (noob :D)

cmq è bastata un po' di ricerchina e
Code:
emerge -epv kdebase-meta | awk '/-arts*/ {print "="$4}'
=kde-base/kpersonalizer-3.4.0
=kde-base/kdebase-startkde-3.4.0-r1
=kde-base/drkonqi-3.4.0
=kde-base/konqueror-3.4.0
=kde-base/konsole-3.4.0


pronto da dare in pasto ad emerge :D :D
Back to top
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Thu May 19, 2005 9:18 pm    Post subject: Reply with quote

Per favore metti il tag [Risolto] al titolo del post.
_________________
Registered as User #281564 and Machines #163761
Back to top
View user's profile Send private message
soulfire
n00b
n00b


Joined: 09 Apr 2004
Posts: 70
Location: Italy

PostPosted: Thu May 19, 2005 9:23 pm    Post subject: Reply with quote

ops, chiedo venia... lo metto subito
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) 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