Raspberry pie Linux sh script file function error: not found

contact with raspberry pie script file for the first time, this is downloaded on github, why report not found"s fault?

function install_module {         -sharp 
  src=$1
  mod=$2

  if [[ -d /var/lib/dkms/$mod/$ver/$marker ]]; then    -sharp 
    rmdir /var/lib/dkms/$mod/$ver/$marker
  fi

  if [[ -e /usr/src/$mod-$ver || -e /var/lib/dkms/$mod/$ver ]]; then   -sharp 
    dkms remove --force -m $mod -v $ver --all
    rm -rf /usr/src/$mod-$ver
  fi
  mkdir -p /usr/src/$mod-$ver
  cp -a $src/* /usr/src/$mod-$ver/
  dkms add -m $mod -v $ver
  dkms build $kernels -m $mod -v $ver && dkms install --force $kernels -m $mod -v $ver

  mkdir -p /var/lib/dkms/$mod/$ver/$marker
}

install_module "./" "seeed"

error:


./install.sh: 30: ./install.sh: function: not found
./install.sh: 34: ./install.sh: [[: not found
./install.sh: 38: ./install.sh: [[: not found
./install.sh: 38: ./install.sh: -e: not found

ask others, it seems that the execution of script files in different versions of linux is different, or there is no need to write function, but I also try to delete function, but I still report an error and ask the boss for advice

Dec.03,2021

scripts are compatible with specific shell versions. You need to know your shell version first.

echo $SHELL

if your script is compatible / bin/bash you can declare

on the first line of the script.
-sharp!/bin/bash

-sharpyour code below
echo "hello"

if you want to know which shell, the system supports, you can try

$ cat /etc/shells
Menu