hello
first year of learning linux and bash script
Now i wrote a bash script with a function.
Today i recieved a email from my teacher that 1 function only can have 1 command and no more then 1?
thats a part of the script
Code:
function tx_unreachable_msg()
{
LOGLINE="[$DATE] no ip service unreachable"
typewriter "$NOIPSERVICE niet bereikbaar" .1
sleep 1
typewriter "Mail wordt verzonden naar $email" .1
mail -s "NO ip mail error" "$email"<<EOF
dynupdate.no-ip.com niet bereikbaar @ $DATE
EOF
}
it's part dutch part english but the point is that the first LOGLINE is forbidden in the function because i use the functie to send a mail end not to write a logline but that's a part of the command in my case?
So what does this function?
If the no ip service is unreachable then it's write to /etc/var/log/no-ip and after the sleep it's send a simpel mail to the adres in the variabele mail.
i read here at the first line:
Quote:
Shell functions are a way to group commands for later execution using a single name for the group.
so is it true that my function is wrong and so no can someone point me to a website where it's say that more commands are allow in 1 function0
grts b