Re: sh

Página Inicial

Reply to this message
Autor: Edgar Bonet
Data:  
Para: guilde
Assunto: Re: sh
Patrick Dupre a écit :
> La commande "magique" permet d'extraire un nom sans son extension.
> (je ne comprends pas comment ca marche!).
> nom=${1%.*}
>
> Comment je peux extraire l'extension seulement ?


${1#*.}

Mais je ne crois pas que ça marche dans le bon vieux sh : c'est du bash.

C.f. man bash, section « Parameter Expansion ».

Edgar.