Here i have got various inputs from keyboard and checked these validations此代碼有什麼問題
Book_id必須是唯一的。
主題代碼只能是UNIX或C.The Shelll我的工作是bash的
我得到下列錯誤
./test.sh:行5:聲明:`= 0' :不是一個有效標識
/test.sh:第13行:UNIX:找不到命令
./test.sh:行92:語法錯誤:文件
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
提及您正在編寫這個程序的編程語言可能會有所幫助。 –
這是哪個shell試圖運行? –
起初我以爲是bash,但是if語句都搞砸了。 – falstro