Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[TIP] - grep en couleur - (alias)
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
Mac Cloud
Apprentice
Apprentice


Joined: 27 Sep 2004
Posts: 214
Location: In a galaxy far far away...

PostPosted: Wed Nov 10, 2004 9:23 am    Post subject: [TIP] - grep en couleur - (alias) Reply with quote

Et hop un tout petit tip de rien du tout mais bien simpa tout de meme !
Ajoutez à votre .bashrc
Code:
alias grepc="grep --color=always"


comme ca :
$grepc"grep" .bashrc
alias grepc="grep --color=always"


Bon l'exemple est mauvais mais dens un dmesg ca aide bien !

EDIT : correction suite aux remarques désagréables de tous :cry: :wink:
_________________
Vous prouver que j'ai raison serait admettre que je puisse avoir tort.
Beaumarchais


Last edited by Mac Cloud on Wed Nov 10, 2004 7:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
kernelsensei
Bodhisattva
Bodhisattva


Joined: 22 Feb 2004
Posts: 5619
Location: Woustviller/Moselle/FRANCE (49.07°N;7.02°E)

PostPosted: Wed Nov 10, 2004 9:44 am    Post subject: Reply with quote

pas mal ... moi je prefere me faire un alias du style
Code:
grep_color=...
, il me semble que la couleur peut foutre la merde dans certains scripts bash non ?
_________________
$ ruby -e'puts " .:@BFegiklnorst".unpack("x4ax7aaX6ax5aX15ax4aax6aaX7ax2aX5aX8 \
axaX3ax8aX4ax6aX3aX6ax3ax3aX9ax4ax2aX9axaX6ax3aX2ax4ax3aX4aXaX12ax10aaX7a").join'
Back to top
View user's profile Send private message
bosozoku
Advocate
Advocate


Joined: 11 Jan 2004
Posts: 2431
Location: Roazhon

PostPosted: Wed Nov 10, 2004 1:07 pm    Post subject: Reply with quote

J'ai utiliser la méthode Mac Cloud et ça marche, maintenant si ça fout le caca dans certains cas voyons kernel sensei ^^

C'est une variable d'environnement à exporter grep_color= ?
_________________
Stationlinux.org - Wiki Fvwm FR - Config Fvwm
Back to top
View user's profile Send private message
theturtle123
l33t
l33t


Joined: 19 Sep 2003
Posts: 621
Location: Lille, France

PostPosted: Wed Nov 10, 2004 1:10 pm    Post subject: Reply with quote

Code:
alias grep_color="grep --color=always"

dans ton
Code:
.bashrc

c'est juste que kernelsenseï préfère renommer la commande... dans le même style que les ll et autres
pour faire au milieu, je propose un
Code:
alias grepc="grep --color=always"

:twisted:
Back to top
View user's profile Send private message
bosozoku
Advocate
Advocate


Joined: 11 Jan 2004
Posts: 2431
Location: Roazhon

PostPosted: Wed Nov 10, 2004 1:11 pm    Post subject: Reply with quote

Ah ok je n'avais pas compris comme ça. Bah oué c'est ce que j'ai fait ^^ (le grepc)
_________________
Stationlinux.org - Wiki Fvwm FR - Config Fvwm
Back to top
View user's profile Send private message
theturtle123
l33t
l33t


Joined: 19 Sep 2003
Posts: 621
Location: Lille, France

PostPosted: Wed Nov 10, 2004 1:14 pm    Post subject: Reply with quote

ouep le problème avec la méthode de Mac Cloud, c'est que tout appel à grep par un script (genre dans une chaine de pipe) pourrait se terminer par une erreur fatale puisque ça rajoute des caractères pour la couleur
un truc dans le genre :roll:
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