nutools/legacy/sysinc/usebash

21 lines
553 B
Plaintext
Raw Permalink Normal View History

2013-08-27 15:14:44 +04:00
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
# usebash: requiere l'utilisation de bash pour lancer ce script
use_bash=1
if [ -n "$BASH" ]; then
if [ `basename "$BASH"` != sh ]; then
use_bash=
fi
fi
if [ -n "$use_bash" ]; then
default_bash="`which bash 2>/dev/null`"
for bash in "$default_bash" /bin/bash /usr/bin/bash /usr/local/bin/bash; do
if [ -x "$bash" ]; then
exec "$bash" "$0" "$@"
fi
done
echo "error: Ce script necessite bash"
exit 1
fi
unset use_bash