Springe zum Hauptinhalt

Bourne
next up previous contents
Next: Anzeigen von Prozeß-Hierarchien Up: Beispiele für Shell-Programmierung Previous: Varianten des Sieb-Filters

Primitive Turbo-C-Variante

#!/bin/sh
#
# "Turbo-C"
#
# Aufruf: turboc <prog_name>
#
if [ $# -ne 1 ]
then
    echo "usage: turbo <prog_name>"
    exit
fi
while true
do
    vi $1.c
    if cc -o $1 $1.c
    then
        ./$1
        while true
        do
            echo -n "AGAIN? [y/n]:"
            read ans
            case $ans in
                y|Y)    continue 2;;
                n|N)    break 2;;
                *)        continue;;
            esac
        done
    else
        echo -n ENTER RETURN TO CONTINUE:
        read ans
        continue
    fi
done