Re: Bash |
|
Esta mensagem é parte da seguinte discussão: | |
---|---|
![]() | Árvore completa da discussão ordenada por data |
![]() ![]() ![]() ![]() ![]() ![]() | Frédéric Mantegazza em ![]() |
![]() ![]() ![]() ![]() ![]() ![]() | Miguel Moquillon em ![]() |
> ${1%.*}
Cela permet de supprimer l'extension d'un fichier
> ${@##*/}
C'est utiliser pour récupérer le nom d'un fichier, à partir de son chemin complet
man bash : <extrait> ${parameter#word} ${parameter##word} The word is expanded to produce a pattern just as in pathname expansion. If the pattern matches the beginning of the value of parameter, then the result of the expansion is the expanded value of parameter with the shortest matching pattern (the “#” case) or the longest matching pattern (the “##” case) deleted. If parameter is @ or *, the pattern removal operation is applied to each positional parameter in turn, and the expansion is the resultant list. If parameter is an array variable subscripted with @ or *, the pattern removal operation is applied to each member of the array in turn, and the expansion is the resultant list. ${parameter%word} ${parameter%%word} The word is expanded to produce a pattern just as in pathname expansion. If the pattern matches a trailing portion of the expanded value of parameter, then the result of the expansion is the expanded value of parameter with the shortest matching pattern (the “%” case) or the longest matching pattern (the “%%” case) deleted. If parameter is @ or *, the pattern removal operation is applied to each positional parameter in turn, and the expansion is the resultant list. If parameter is an array variable subscripted with @ or *, the pattern removal operation is applied to each member of the array in turn, and the expansion is the resultant list.
Cette page de "man" est particulièrement obscure !!!! ;)
De rien.
Cordialement
Olivier -- ~~~~~~~ _____/\_____ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Phoenix / _ \/ _ \ Olivier Allard-Jacquin / / \ / \ \ Web: http://olivieraj.free.fr/ /___/ / \ \___\ Mail: olivieraj@??? ~~~~ ///// ///\\\ \\\\\ ~~~~~~~~~~~~~~~~~~~~~~~ Linux Powered !!
Esta mensagem foi enviada para as seguintes listas: | ||||
---|---|---|---|---|
Guilde Informações da lista | Mensagens recentes | ![]() | Bash | Re: Bash | ![]() |
Archive des listes de la GUILDE administrado por L'administrateur | Lurker (versão 2.3) |