This question already has an answer here:

I've tried several modifications to see why it's not working, but I can't find the answer.

Here is my code, this is in french but this is just a normal fonction that ask to the user if he's ready to start.

function start 
    echo "Vous etes sur le point de lancer la generation, etes-vous pret(e)? [OUI/NON]"
    read touche
    case $touche in
        [Oo] | [Oo][Uu][Ii] )   
        echo "Demarage du bash..."
        [Nn] | [Nn][Oo][Nn] )
        echo "Annulation du bash..."

This is what I get :

  sh start.sh
  : unfindable command
  »art.sh: line 3: syntax error close to the « symbol
  'tart.sh: line 3: `function start

marked as duplicate by Gilles, jasonwryan, slm Mar 7 '15 at 2:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • try setting #!/bin/ksh in the beginning of the script. – taliezin Mar 6 '15 at 7:55
  • Already done :) – Julien S Mar 6 '15 at 8:03
  • 1
    check your file if it is saved in dos format and convert it to unix format. – taliezin Mar 6 '15 at 8:12
  • I think you run on AIX and version of ksh is lower. – PersianGulf Mar 6 '15 at 8:22
  • 1
    @taliezin, you don't need the #! line if you start the script as the OP did with explicitly calling sh. @mikeserv, you don't need the ( in the case pattern; also in old ksh's, and also in the SUS/POSIX standards, this is standard syntax, and was defined that way since bourne shell. – Janis Mar 6 '15 at 10:28

My file was saved in DOS Format, I used dos2unix start.sh to convert it.

Not the answer you're looking for? Browse other questions tagged or ask your own question.