|
|
|
|
Posté par
kingos, le mardi 9 mai 2006 à 11:13:08Salut,
man cut [jp@MDK tmpfs]$ echo "save_1_1_1" | cut -d_ -f1 save [jp@MDK tmpfs]$;-)) Z'@+...che. JP : Zen, my Nuggets ! ;-) Le savoir n'est bon que s'il est partagé. |
Essaye cette construction sous bash:
johan@johan:~$ myvar=abc_def_ghi
johan@johan:~$ echo ${myvar%%_*}
abc
johan@johan:~$ thefile=DSC0123-987.jpg
johan@johan:~$ echo ${thefile%%-*}
DSC0123
Partie finissante extension
johan@johan:~$ echo ${thefile##*.}
jpg
man bash Remplacement des paramètres Gates gave you the windows. GNU gave us the whole house.(Alexandrin) |
OK merci à tous les deux, c'était clair et rapide!
ça marche Merci bcp |
| 08/11 23h54 | [Shell] Récupérer son IP publique | Shell |
| 10/04 18h26 | Exercice assembleur x86 occurence d'un caractère | x86 |
| 26/02 16h52 | Sed - Introduction à SED - Part III | Sed |
| 10/04 21h29 | Screen | Shell |
| 25/02 15h16 | Sed - Introduction à SED | Sed |
| 18/04 15h39 | [shell] Récupérer certains caractère | 3 |
| 23/11 18h26 | ASP récupérer premier caractère d'une chaine | 0 |
| 30/05 14h05 | [Shell ksh] Retirer premier caractère | 5 |
| 22/05 10h33 | [Shell] enlever les 11 premier caractères | 9 |
![]() | SSH Secure Shell - SSH secure shell for workstations est un client SSH flexible permettant de se connecter de façon sécurisée à des... | Catégorie: Telnet/SSH Licence: Open Source |
![]() | ShellEnhancer - ShellEnchancer est un programme d'amélioration des fonctions de base de Windows. Il rend les interfaces plus stables et plus... | Catégorie: Personnalisation Licence: Freeware/gratuit |
![]() | Gant2Ocean ShellPack - Pour ceux qui aiment bien personnaliser l'apparence de leur interface graphique Windows ou Thèmes, ils seront gâtés. ... | Catégorie: Personnalisation Licence: Freeware/gratuit |
![]() | Lupas Rename - Lupas Rename est un programme permettant de renommer plusieurs fichiers à la fois. Les fonctionnalités de ce logiciel... | Catégorie: Gestion de fichiers Licence: Freeware/gratuit |
![]() | Metronic ZapBox Premier | Catégorie: Adaptateur TNT | 49.45 € Amazon.fr |
![]() | Premier Manager 2000 | Catégorie: Jeu Playstation | |
![]() | Shellshock: Nam 67 | Catégorie: Jeu vidéo Xbox | 3.00 € Micromania |
![]() | M and M's Shell | Catégorie: Jeu Playstation |