- Jun 2025
-
www.npmjs.com www.npmjs.com
-
If you prefer to write scripts that don't need to be passed into Vite Node, you can declare it in the hashbang. Simply add #!/usr/bin/env vite-node --script at the top of your file:
-
- May 2025
-
github.com github.com
-
Recipes that start with #! are called shebang recipes, and are executed by saving the recipe body to a file and running it. This lets you write recipes in different languages:
Tags
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
#!/usr/bin/env npx ts-node // TypeScript code Whether this always works in macOS is unknown. There could be some magic with node installing a shell command shim (thanks to @DaMaxContext for commenting about this). This doesn't work in Linux because Linux distros treat all the characters after env as the command, instead of considering spaces as delimiting separate arguments. Or it doesn't work in Linux if the node command shim isn't present (not confirmed that's how it works, but in any case, in my testing, it doesn't work in Linux Docker containers). This means that npx ts-node will be treated as a single executable name that has a space in it, which obviously won't work, as that's not an executable.
-
-
-
If you prefer to write scripts that don't need to be passed into Vite Node, you can declare it in the hashbang.
-
-
bash.cyberciti.biz bash.cyberciti.biz
- Jun 2021
-
docs.npmjs.com docs.npmjs.com
-
Please make sure that your file(s) referenced in bin starts with #!/usr/bin/env node, otherwise the scripts are started without the node executable!
-
- Apr 2021
-
core.tcl-lang.org core.tcl-lang.org
-
#!/bin/sh # -*- tcl -*- # The next line is executed by /bin/sh, but not tcl \ exec tclsh "$0" ${1+"$@"}
-
-
empty.sourceforge.net empty.sourceforge.net
-
can be easily invoked directly from shell prompt or script
Can't expect / unbuffer / etc. (whatever this is attempting to contrast itself with) be easily invoked directly from shell prompt or script too??
Okay, I guess you have to know more about how
expect
is invoked to understand what they mean. One glance at the examples, comparing them, and all becomes clear:#!/bin/sh empty -f -i in -o out telnet foo.bar.com empty -w -i out -o in "ogin:" "luser\n"
I didn't realize that expect required/expected (no pun intended) to be used in scripts with its own shebang line:
#!/usr/bin/expect spawn telnet foo.bar.com expect ogin {send luser\r}
That does make it less easy/normal to use expect within a shell script.
I was coming to the expect project from/for the
unbuffer
command, which by contrast, is quite easy to include/use in a shell script -- almost the same asempty
, in fact. (Seems like almost a mismatch to haveunbuffer
command inexpect
toolkit then. Or isexpect
command the only odd one out in that toolkit?)
-
- Mar 2021
-
askubuntu.com askubuntu.com
-
Given the deskopen script, you can use a reference to it as the shebang line in a .desktop file
-