I am trying to write a script to manage apt-get (although I use apt-fast.) Trying to cut down on key strokes to keep my system up to date with a little choice (Freedom.)
I want to be able to form a menu of things to do, choose one, and get the appropiate command to execute.
At the moment I just want the choice to print out. When this is going OK, I will proceed in getting the commands to execute.
This is my script (that fails disamaly.)
Code: Select all
#!/bin/bash
clear
echo "You are currently logged in as" $USER"."
echo "Please choose from the list below."
echo "1. update"
echo "2. upgrade"
echo "3. dist-upgrade"
echo "4. autoremove"
echo "5. "
echo "6. "
echo "7. "
echo "8. "
echo "9. "
echo "10. "
echo -n "Please Make Your Choice... "
read name
if $name == 1
echo "update"
if $name == 2
echo "upgrade"
if $name == 3
echo "dist-upgrade"
if $name == 4
echo "autoremove"
if $name == 5
echo "5"
if $name == 6
echo "6"
if $name == 7
echo "7"
if $name == 8
echo "8"
if $name == 9
echo "9"
if $name == 10
echo "10"
else
echo "INCORRECT CHOICE"
fi
Please, please, please help.
Thank You
James (Tamworth N.S.W Australia)