I'm currently working on homework for a Unix course and I've got everything else done but I just can't figure out what I've done wrong here. I've done this exact same script in csh (but we need to do it in bash as well.) I've already fixed a few errors but now the one I'm getting is "Variable Syntax" when I try to run it.
I've tried using double brackets for the while and ifs I've also tried declaring the variables for the inputs before I try to read to them I've also tried bugging several people in my class but most of them are pretty clueless and just copy off others.
#/!bin/bash
#
#Menunix - Bash
#
#Usage: menunixb
input = "$(1)"
while [ $input != 5 ]
do
echo Please choose an option
echo 1: List Files
echo 2: Display today's date and time
echo 3: Check whether a file is a directory or not
echo 4: Create a file backup
echo 5: Quit
read input
case $input in
1)
ls
;;
2)
echo -n Time:
date +"%T"
echo Date:
date +"%D"
;;
3)
echo What file do you wish to check
read finput
if [ -d $finput ] ; then
echo $finput is a Directory
elif [ -f $finput ] ; then
echo $finput is a File
else
echo $finput does not exist
;;
4)
echo Please enter filename to backup
read binput
cp $binput{,.bak}
;;
5)
exit 1
*)
echo Please choose a valid input
exit 1
esac
done
#EOF