En este ejemplo vemos otras condiciones posibles que podemos comprobar:
if [ $# -eq 1 ]
then
echo "Uso: $0 fichero"
exit
fi
if [ -f $1 ]
then
echo "$1 Fichero regular"
|
fi
if [ -d $1 ]
then
echo "$1 directorio"
|
fi
if [ -c $1 ]
then
echo "$1 dispositivo carácter"
|
fi
if [ -b $1 ]
then
echo "$1 dispositivo bloque"
|
fi
if [ -p $1 ]
then
echo "$1 tubería con nombre"
|
fi