I found some very useful shell scripts at bashscripts.org. You may use them too... take a look.
A very small (10000 lines?) script... check it.
#!/bin/bash
#######################################################
# Bash CALCulator 2
#######################################################
#
#
# FILE: bashcalc2.sh
# VERSION: 1.1
# DATE: 06-19-2006
#
# AUTHOR: Crouse - Please visit bashscripts.org and usalug.org
#
#
########################################################
header ()
{
clear; echo "Bash Calculator - Enter a calculation and hit enter";
echo "---------------------------------------------------";
}
calc ()
{
header
while true
do read -p "" bashcalc;
if [ "$bashcalc" = "quit" ]
then
exit
fi
if [ "$bashcalc" = "clear" ]
then
calc
fi
if [ "$bashcalc" = "help" ]
then
clear
echo "Options include:"
echo " help - This help file"
echo " clear - Clears the screen"
echo " quit - Quits the program"
echo " "
read -p "Hit any key to continue" temp;
calc
fi
echo "scale=4; ${bashcalc}" | bc ;
echo "---------------------";
done
}
# Program run starts here
calc
exit 0
I know you have python or perl but admit it, you always liked bash scripting, after all, this is our interpreter.
No hay comentarios:
Publicar un comentario