For all below program facing this - common error while getting started refreshing shell programming:( Any reason or mis-leaded executions - please confirm)
==========For below line of code on pract3.sh=======================
function user_input()
{
read -p "Please enter cost center" costcenter
}
=============pract2.sh==========
ash
function get_salestax()
{
if test "$1" = ""
then
echo "You must supply a full expense amopunt."
return
else
echo "Full expense amount:" $1
nontax_amount=`echo "$1/1/15" | bc`
tax_amount=`echo "$1-$nontax_amount" | bc`
echo "Non tax amount:"$nontax_amount
echo "Tax amount:" $tax_amount
return $tax_amount
fi
echo "Operation completed successfully!"
}
மேலே கொடுக்கப்பட்டுள்ள தகவல்கள் சரியாக புரியவில்லை. ctrl-alt-t கொடுத்து டெர்மினலை துவக்கவும். பின் எந்த ஷெல்ஸ்கிரிப்டில் பிழை வருகின்றதோ அந்த ஷெல்ஸ்கிரிப்டை இயக்கவும். சிக்கல் வந்தபில் டெர்மினல் திரையை திரைப்பதிவு எடுக்கவும். பின் அதை இங்கே பகிரவும்.
After executing, I am expecting to execute without error and like to get an input after execution of above code. I never tried functions with shell, while experimenting with functions got this problem.
With an another instance, seen different problem with execution on shell scripting.
Error: pract4.sh: 8: Bad substitution ==> Was observed.
Solution found: When I try to execute from $PS1 ==> Worked ( Attached the observed copy)
Since, shell scripting - I have worked on basic- was advancing with experimenting with functions() ==> Seen persistent problems - That’s why like to ask for clarifications:
After executing, I am expecting to execute without error and like to get an input after execution of above code. I never tried functions with shell, while experimenting with functions got this problem.
ஒவ்வோரு ஷெல்ஸ்க்ரிப்டாக செல்வோம். pract3.sh ஐ இயக்கியவுடன் அந்த டெர்மினலை திரைப்பதிவு எடுத்து இங்கே பகிரவும்.