pas trouvé d'erreur lors de l'insertion #!/bin/sh

J'ai commencé à apprendre Linux shell script, quand j'ai écrit ce script, j'ai eu une erreur,

./my_script: 4: read: Illegal option -n
./my_script: 5: ./my_script: [[: not found

J'ai trouvé sa raison #!/bin/sh ligne, je peux toujours lancer le script sans cette ligne, mais il ne sera pas exécuter des codes comme /n

#!/bin/sh
# Shell installer for gurb customizer. by Naveen Gamage.

OS=$(lsb_release -si)
ARCH=$(uname -m | sed 's/x86_//;s/i[3-6]86/32/')
VER=$(lsb_release -sr)

grabninstall() {
    sudo add-apt-repository ppa:danielrichter2007/grub-customizer
    sudo apt-get update
    sudo apt-get install grub-customizer    
}

echo "Installer for GRUB CUSTOMIZER\n"
echo "GURB CUSTOMIZER"
echo "A tool for editing and configuring boot menu (GRUB2/BURG).\n"

read -p "Do you want to install Grub Customizer for $OS ${VER} [$ARCH] ? (Y/n) " -n 1

if [[ $REPLY =~ ^[Yy]$ ]]
then
    echo "The installer is downloading and installing GRUB Customizer!";
    echo "This action may require your password.\n";
    grabninstall
else
    echo "user quit"
    echo "Installation was unsuccessful."
fi

Je fais cela sur Ubuntu 12.10.

et qui sh donne cette sortie

/bin/sh

aucune idée de l'endroit où j'ai fait de mal?

  • Ne ls -l /bin/sh point de bash?
  • oui, lrwxrwxrwx 1 root root 4 13 Mai à 16:01 /bin/sh -> dash
  • dash != bash