Stap 1: De Code
#!/bin/sh #Front end for GCC compiler. # # cd C while [ $# -eq 0 ] do WORK=`cat WORKFILE.txt` WFLOADED=1 WORKC=$WORK".c" CHOICE=`zenity --title="GCC" --text="Work File: "$WORK --height=275 --width=300 \ --list --column="Front End For GCC Compiler" "Create or Select Work FIle" "Edit "$WORKC "Compile "$WORKC "Test Run "$WORK "Terminal" "Exit"`
if [ "$CHOICE" = "Create or Select Work FIle" ]; then TEMP=`zenity --entry --entry-text="Currently: "$WORK --width=300` if [ $WFLOADED -gt 0 ]; then WORK=$TEMP WORKC=$WORK".c" echo $WORK > WORKFILE.txt fi fi
if [ "$CHOICE" = "Edit "$WORKC ]; then if [ $WFLOADED -gt 0 ]; then gedit $WORK".c" else zenity --info --text="Work file is empty, create or select a work file." --timeout=2 fi fi
if [ "$CHOICE" = "Compile "$WORKC ]; then if [ $WFLOADED -gt 0 ]; then clear gcc $WORK".c" -lm mv -f a.out $WORK else zenity --info --text="Work file is empty, create or select a work file." --timeout=2 fi fi
if [ "$CHOICE" = "Test Run "$WORK ]; then if [ $WFLOADED -gt 0 ]; then echo " " ./$WORK echo " " echo -n "Press to continue: " read WORKHOLD clear else zenity --info --text="Work file is empty, create or select a work file." --timeout=2 fi fi
if [ "$CHOICE" = "Terminal" ]; then gnome-terminal fi
if [ "$CHOICE" = "Exit" ]; then exit 0 fi
done