Here i have got various inputs from keyboard and checked these validations
Book_id must be unique.
Subject code can only be either UNIX or C.The Shelll i work is bash
i got the following errors
./test.sh: line 5: declare: `=0': not a valid identifier
/test.sh: line 13: unix: command not found
./test.sh: line 92: syntax error: unexpected end of file
echo -n "Enter Book Accession number: "
read Book_accession_number
declare -a var_id
declare -i i =0
subject()
{
echo -n "Enter Subject code:"
read Subject_code
if ("$Subject_code" != "unix")
then
{
if ("$Subject_code" != "c")
then
{
echo "please enter unix or c"
subject
}
fi
}
fi
subject
Book()
{
echo -n "Enter Book ID:"
read Book_id
echo -n "Enter Book Accession number: "
read Book_accession_number
declare -a var_id
declare -i i =0
while(j -ne i)
{
j++
if(var_id[i]==Book_id)
then
{
echo "please enter a unique id"
Book
}
fi
}
Book
echo -n "Enter Author Name:"
read Author_name
echo -n "Enter Year of Publication:"
read YOP
echo -n "Enter Title of Book:"
read TOB
echo -n "Enter Publisher's name:"
read PUB_Name;
echo -n "Enter Price: "
read Price