Hacker News new | past | comments | ask | show | jobs | submit login

I had mostly done some short stuff in bash that does not need much flow controls and loops etc; most programming I will use C instead, which does have goto and is sometimes useful even though usually the other flow controls are better. My own programming language designs do have a goto command because it is sometimes useful; the Free Hero Mesh programming language has both goto and gosub, in addition to the structured flow controls (if/then, begin/while/repeat, etc).

The way is done in that article doesn't seem best way to do; modifying the shell itself to seek the shell script file for it seem to be better in my opinion, or perhaps using the "enable" command to add your own built-in "goto" command (although I don't know if the API supports that). Another message on here mentions an external program messing with the file descriptors, but does bash use a consistent file descriptor number for the shell script file with which this will work?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: