Blog de G. MOKOLOMBOKA

Ingénieur J2EE, Flex, Intégration

La commande Sed

Bookmark this on Hatena Bookmark
Hatena Bookmark - La commande Sed
Share on Facebook
Post to Google Buzz
Bookmark this on Yahoo Bookmark
Bookmark this on Livedoor Clip
Share on FriendFeed
La commande SedBlog de G. MOKOLOMBOKA

grep $USER /etc/passwd | sed "s/::/%/" |cut -d'%' -f1

Explication: 
parcourir le fichier  /etc/passwd  et retourner la ligne concernant le nom de l'utilisateur en cours  |  remplacer (s) les  ::  par  %  dans le résultat | 
dans le résultat, supprimer l'occurrence  %  (-d'%') et tout ce qui la suit la première occurrence vérifiant (-f1) 
Share and Enjoy
Tinyurl for this post
Tag: , ,

Your email address will not be published. Required fields are marked *

*

IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)

What is 3 + 2 ?
Please leave these two fields as-is: