Can you please tell me why this script is executing but i am getting no result...also can you tell me what is this gettime() doing?
in a script i wrote this hour.SH
--------------------------
gettime() {
date '+%H' | {
read hour
TIME=${hour}
}
}
:
----------------------
when i do ./hour.SH ...i get no result
ksh works, bash and bsh no. Why ? ksh has done like syntax idea is, bash makers has technical answer (last 10 years). There are many forums, where has been asked this question manymanmany times from other shell makers, why not.
Make function like command then no problem in any shell.
Here is solution for read problem in other than ksh (this solution works with ksh also):