No. Why should that be a problem? It's syntactically correct. The else branch just won't be reached in this case. Open a terminal and try something like:
Code:(if true;then exit;else some garbage;fi)
No. Why should that be a problem? It's syntactically correct. The else branch just won't be reached in this case. Open a terminal and try something like:
Code:(if true;then exit;else some garbage;fi)
+1 to what ofnuts said.
There may be a problem if /var/tmp (or /tmp if you choose to use it instead) is mounted noexec. In this case, invoke it like
Code:exec bash /var/tmp/$scriptname
It's definitely possible to copy itself to tmp and execute the copy with the idea that it would relieve the device it was hosted on from being locked. I had considered that route, but then I figured it might not be worth the trouble and probably easier to just find a way to run the exec eject as the last command. But thanks for everyone's help.
Bookmarks