Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wasted a lot of time on this one:

If you declare a local variable and set it in the same step e.g: local MYVAR = $(/bin/false) The return code you get is from the local declaration, not assigning a value to the variable. It can be quite confusing when you afterwards check the return code with $? and it returns 0. Avoid it by assigning the value in a seperate command.



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

Search: