update doc for 3-liner startup scripts
Closed / Rejected523595ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2002-02-27 21:09:45
http://www.tcl.tk/man/tcl8.4/UserCmd/tclsh.htm recommends
the following 3-lines for startup scripts:
#!/bin/sh
# the
next line restarts using tclsh \
exec tclsh "$0"
"$@"
However, as mentioned on
http://mini.net/tcl/812.html, it would be more approriate to use
${1+"$@"}
The man page for wish
(http://www.tcl.tk/man/tcl8.4/UserCmd/wish.htm) also needs
to be fixed in this respect.
Hemang.
dgp Ticket [523595ffff]: 3 changes
[History diff]2002-02-28 07:57:08
jenglishplain2002-03-15 23:56:37
Logged In: YES
user_id=68433
I think the ${1+"$@"} form is just a cargo-cult idiom. AFAIK, the "some versions of sh (with) a bug" mentioned on the Wiki was actually just *one* vendors /bin/sh (I forget which, but it was probably HP-UX), which has long since been fixed.
Unless someone can locate an actual broken /bin/sh in the wild that has this bug, it's probably best to leave the documentation as it is.
dgpplain2002-04-22 21:42:15
Logged In: YES user_id=80530 I agree with jenglish. The proposal is more an example of how to work around bugs in other people's software, rather than documenting proper usage of our own. Good information to have available (Wiki), but not the best default documentation. Moved to pending; will close automatically unless a more compelling case is made.
Log in (anonymous is fine) to add a comment.