Off-Topic > Off-Topic - Tiny Core Lounge
Happy New Year :)
Lee:
Cogratulations coreplayer2. You are the first one to teach me something cool this year. I have so often wished for the -= operator but, since I typically don't use "let", I never new it was there. I guess one of the long term hazards of BASIC-as-a-first-language is the deeply ingrained notion that "VAR=VALUE" is exactly the same as "let VAR=VALUE", which clearly is not the case in shell scripting.
--- Code: ---num=`expr ${NUM} \- 1`
--- End code ---
--- Code: ---let num-=1
--- End code ---
Thanks for demonstrating such a useful tool.
coreplayer2:
Ha ha! Your welcome, glad it was enlightening. Am trying to learn bash as fast as possible, btw this "let" which I found quite interesting, was able to use on a project I'm currently working on. So whilst it was still fresh in mind wrote a countdown the new year.
Navigation
[0] Message Index
[*] Previous page
Go to full version