Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[bash] modification de liste (résolu)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
profy
Tux's lil' helper
Tux's lil' helper


Joined: 08 Jun 2005
Posts: 96
Location: Sophia Antipolis

PostPosted: Tue Jul 12, 2005 2:25 pm    Post subject: [bash] modification de liste (résolu) Reply with quote

Salut,

PROFYPORT init.d # ls -1 /etc/init.d/dansguardian*
/etc/init.d/dansguardian
/etc/init.d/dansguardian-old
/etc/init.d/dansguardianGRP1
/etc/init.d/dansguardianORA
/etc/init.d/dansguardianazer

J'aimerai avoir ca :

-old
GRP1
ORA
azer

Une idée ?
_________________
Plus je connais les hommes, plus j'aime mon pc.


Last edited by profy on Tue Jul 12, 2005 2:42 pm; edited 1 time in total
Back to top
View user's profile Send private message
ttgeub
Guru
Guru


Joined: 20 Jan 2003
Posts: 494
Location: Eindhoven

PostPosted: Tue Jul 12, 2005 2:33 pm    Post subject: Re: [bash] modification de liste Reply with quote

Code:
ls -1 /etc/init.d/dansguardian* | cut -c `echo /etc/init.d/dansguardian | wc -c`-


Voila n'oublie surtout pas le - final :wink:
Back to top
View user's profile Send private message
profy
Tux's lil' helper
Tux's lil' helper


Joined: 08 Jun 2005
Posts: 96
Location: Sophia Antipolis

PostPosted: Tue Jul 12, 2005 2:42 pm    Post subject: Reply with quote

Merciii :)
_________________
Plus je connais les hommes, plus j'aime mon pc.
Back to top
View user's profile Send private message
rg421
Apprentice
Apprentice


Joined: 07 Dec 2004
Posts: 192
Location: Strasbourg

PostPosted: Wed Jul 13, 2005 2:03 pm    Post subject: Re: [bash] modification de liste Reply with quote

ttypub wrote:
Code:
ls -1 /etc/init.d/dansguardian* | cut -c `echo /etc/init.d/dansguardian | wc -c`-


8O Je sais, je sais, c'est déjà résolu, mais il y a surement moyen de faire plus long et plus compliqué mais je manque d'imagination aujourd'hui. Néanmoins, lancer 4 executables, 3 pipes et tellement de fork que je ne les compte plus pour parser une variable... :?
Code:
$ set dansguardian*
$ echo ${@##dansguardian}
 azer GRP1 -old ORA

C'est vachement mieux, non ?

--
Renaud
[EDIT]correction d'une faute de grammaire plus grosse que moi :oops: [/EDIT]


Last edited by rg421 on Wed Jul 13, 2005 2:29 pm; edited 1 time in total
Back to top
View user's profile Send private message
profy
Tux's lil' helper
Tux's lil' helper


Joined: 08 Jun 2005
Posts: 96
Location: Sophia Antipolis

PostPosted: Wed Jul 13, 2005 2:18 pm    Post subject: Reply with quote

C'est vrai en fait je viens de changer de solution et je renseigne au fur et a mesure un repertoire contenant ce qui est en fait ma liste de groupes, c'est plus propre et ca me permet de stocker une description :)
_________________
Plus je connais les hommes, plus j'aime mon pc.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French 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