Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
informatique:linux:awk [2008/02/15 17:42] benoit |
informatique:linux:awk [2018/09/26 15:25] (Version actuelle) benoit [Tutoriels] |
||
---|---|---|---|
Ligne 4: | Ligne 4: | ||
* {{http://www.zikossworld.free.fr/docwiki/shells-unix/awk.html|awk}} | * {{http://www.zikossworld.free.fr/docwiki/shells-unix/awk.html|awk}} | ||
* {{awk-wiki.htm|awk}} | * {{awk-wiki.htm|awk}} | ||
+ | |||
Ligne 32: | Ligne 33: | ||
{ | { | ||
for (i = 2; i <= 4; i = i + 1) | for (i = 2; i <= 4; i = i + 1) | ||
- | print $i | + | print $i |
}' | }' | ||
+ | |||
+ | |||
+ | Affiche **owncloud-9.1.0.tar.bz2** : | ||
+ | echo "https://download.owncloud.org/community/owncloud-9.1.0.tar.bz2" | awk -F"/" '{print $NF}' | ||
+ | | ||
+ | Affiche **https://download.owncloud.org/community/** : | ||
+ | echo "https://download.owncloud.org/community/owncloud-9.1.0.tar.bz2" || awk -F"/" '{OFS="/"; $NF=""}1' | ||