oui et non;
desole j'avais pas teste
myscriptpath=$(dirname $0)
if [ ! -z "${myscriptpath##/*}" ]
then
if [ ! -z "${0##./}" ]
then
myscriptname=$(which $0)
myscriptpath=$(dirname $myscriptname)
fi
if [ -z "${myscriptpath##./}" -o ! -z "${myscriptpath##/*}" ]
then
myscriptpath="$PWD/${myscriptpath#./}"
fi
myscriptpath="${myscriptpath%/.}"
fi
echo $myscriptpath
ca doit gere a peut pres tous les cas:
Daniel Cartron wrote:
> Le mercredi 20 août 2008, Daniel Cartron a écrit :
>> Il y a plus élégant et plus efficace ?
>
> Ben oui suis-je bête, c'est le contraire, il faut tester si c'est . et si oui
> on prend le résultat brut de pwd... J'ai bon, là ?
>
_________________________________
Linux mailing list
[email protected]
http://lists.parinux.org/mailman/listinfo/linux