error in simple script - Minix

This is a discussion on error in simple script - Minix ; Hi, I begin to learn about minix, I write this sh-script -------------------------------------------------------------------------- #/bin/sh while true do cat *** menu *** 1) ls 2) cd 3) exec 4) exit FINE echo -n "scegli: " read RISP case RISP 1) ls ;; ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: error in simple script

  1. error in simple script

    Hi,
    I begin to learn about minix, I write this sh-script
    --------------------------------------------------------------------------
    #/bin/sh

    while true do
    cat << FINE
    *** menu ***
    1) ls
    2) cd
    3) exec
    4) exit
    FINE

    echo -n "scegli: "
    read RISP
    case RISP
    1) ls ;;
    2) echo -n "dir: "
    read CDTO
    cd $CDTO
    ;;
    3) echo -n "cmd: "
    read CMD
    eval $CMD
    ;;
    4) exit ;;
    *) echo "error" ;;
    esac
    done

    -------------------------------------------------------------------

    but when I run it I have error:

    Exec format error



    can youu help me to resolve ?



    thankyou


  2. Re: error in simple script

    sacarde@gmail.com wrote:
    > Hi,
    > I begin to learn about minix, I write this sh-script
    > --------------------------------------------------------------------------
    > #/bin/sh


    #!/bin/sh

    > while true do
    > cat << FINE
    > *** menu ***
    > 1) ls
    > 2) cd
    > 3) exec
    > 4) exit
    > FINE


    FINE # in column 1

    Ciao
    --
    A computer is like an air conditioner,
    it stops working when you open Windows.
    Registered Linux user #337974 < http://giovanni.homelinux.net/ >

  3. Re: error in simple script


    Giovanni wrote:
    > sacarde@gmail.com wrote:
    > > Hi,
    > > I begin to learn about minix, I write this sh-script
    > > --------------------------------------------------------------------------
    > > #/bin/sh

    >
    > #!/bin/sh
    >
    > > while true do
    > > cat << FINE
    > > *** menu ***
    > > 1) ls
    > > 2) cd
    > > 3) exec
    > > 4) exit
    > > FINE

    >
    > FINE # in column 1


    ho spostato FINE a colonna 1
    ma l'errore rimane uguale


  4. Re: error in simple script

    sacarde@gmail.com wrote:

    >>> #/bin/sh

    >> #!/bin/sh


    Did you also insert the exclamation mark on the 1st line?
    Hai messo il punto esclamativo nella 1a linea?

    Ciao
    Giovanni
    --
    A computer is like an air conditioner,
    it stops working when you open Windows.
    Registered Linux user #337974 < http://giovanni.homelinux.net/ >

  5. Re: error in simple script


    Giovanni ha scritto:

    > sacarde@gmail.com wrote:
    >
    > >>> #/bin/sh
    > >> #!/bin/sh

    >
    > Did you also insert the exclamation mark on the 1st line?
    > Hai messo il punto esclamativo nella 1a linea?


    avevo dimenticato.....

    ho dovuto inoltre:

    mettere "do" in una riga separata
    aggiungere il $ a "case $RISP"



    grazie mille


  6. Re: error in simple script


    > aggiungere il $ a "case $RISP"


    e aggiungere "in"


+ Reply to Thread