shebang Questions
5
Solved
Given that Java 9 is upon us and we can finally have a java REPL with jshell I was hoping there was a way to add a shebang to a script and have jshell interpret it.
I tried creating test.jsh:
#!/...
11
Solved
I have made Bash scripts before and they all ran fine without #!/bin/bash at the beginning.
What's the point of putting it in? Would things be any different?
Also, how do you pronounce #? I know ...
4
Solved
I wanted to check out some new features of java 11 which was released two days ago.
JEP 330 states that I could launch a Java-Source-Code-Program without compiling.
It should also support the usage...
3
Solved
I'm writing a rails app and need to run come scripts through ./script/runner
while i could put
#!/home/cannon/src/timetracker/script/runner
at the top, that wont work in production where it n...
Emergence asked 24/6, 2011 at 19:57
5
Solved
I've written a python program. And if I have a shebang like this one:
#!/usr/bin/python
and I make the file executable with:
$ chmod 755 program.py
I can run the program like so:
$ ./program...
8
Solved
My Python script beak contains the following shebang:
#!/usr/bin/env python
When I run the script $ ./beak, I get
env: python\r: No such file or directory
I previously pulled this script from...
Prima asked 17/10, 2013 at 11:46
7
I try to build scripts that work everywhere and always. For this I use a custom-built python, which is always in the parent directory relative to the script.
This way I could load my package on an...
3
#!/usr/bin/env python
I put that at the top of a script. I've seen that should make the script runnable from the command line without the need for python programname.py. Unless I'm misunderstandi...
5
Solved
From reading this thread, it looks like its possible to use the shebang to run Rust *.
#!/usr/bin/env rustc
fn main() {
println!("Hello World!");
}
Making this executable and running does comp...
7
Is there any Bash shebang objectively better than the others for most uses?
#!/usr/bin/env bash
#!/bin/bash
#!/bin/sh
#!/bin/sh -
etc
I vaguely recall a long time ago hearing that adding a dash...
3
Solved
I have a ruby file that does not have a .rb extension, and is instead identified as ruby code with a shebang at the beginning of the file: #!/usr/bin/env ruby. I want to require the code in this fi...
10
I like using shebangs to run my Perl scripts directly:
#!/usr/bin/env perl
What's the shebang for Go programs?
6
Solved
In the header of a Bash script, what's the difference between those two statements:
#!/usr/bin/env bash
#!/usr/bin/bash
When I consulted the env man page, I get this definition:
env - run a p...
5
Solved
I have some python-2.x scripts which I copy between different systems, Debian and Arch linux.
Debian install python as '/usr/bin/python' while Arch installs it as '/usr/bin/python2'.
A problem is t...
2
Solved
Relative shebang: How to write an executable script running portable interpreter which comes with it
Let's say we have a program/package which comes along with its own interpreter and a set of scripts which should invoke it on their execution (using shebang).
And let's say we want to keep it port...
2
Solved
I need to write a Python script that's compatible with both Python 2 and Python 3, can be called directly from a shell (meaning it has a shebang), and can run on systems that have either Python ver...
Overplus asked 28/10, 2021 at 18:57
6
I'm currently using the serve script to serve up directories with Node.js on Windows 7. It works well in the MSYS shell or using sh, as I've put node.exe and the serve script in my ~/bin (which is ...
Psychologist asked 25/7, 2011 at 14:55
8
Solved
I am using Bash
$ echo $SHELL
/bin/bash
and starting about a year ago I stopped using Shebangs with my Bash scripts. Can
I benefit from using #!/bin/sh or #!/bin/bash?
Update: In certain situat...
8
Solved
I've seen in a number of places, including recommendations on this site (What is the preferred Bash shebang?), to use #!/usr/bin/env bash in preference to #!/bin/bash. I've even seen one enterprisi...
1
I really like the structure of a NX workspace, and that lead me to start using it when building a new CLI project.
I started with creating a @nrwl/node:application but i currently is having some i...
Fewness asked 18/6, 2020 at 21:38
3
Solved
How can an ES6 module be run as a script in Node?
When I try this shebang I get an error:
#!/usr/bin/env node --experimental-modules
/usr/bin/env: ‘node --experimental-modules’: No such file ...
Simmers asked 10/1, 2018 at 3:8
22
I see these at the top of Python files:
#!/usr/bin/env python
#!/usr/bin/env python3
It seems to me that the files run the same without that line.
5
Solved
I am working on a medium sized python (2.7) project with multiple files I import. I have one main python file which starts the program. Other files contain class definitions, functions, etc.
I was...
1
What happens if the interpreter specified after #! is not available?
I know that after the shebang I have to specify the interpreter (best practice is /bin/bash). As a beginner I don't dare to try ...
15
Solved
Should I put the shebang in my Python scripts? In what form?
#!/usr/bin/env python
or
#!/usr/local/bin/python
Are these equally portable? Which form is used most?
Note: the tornado project ...
Perspicuity asked 2/8, 2011 at 6:35
1 Next >
© 2022 - 2025 — McMap. All rights reserved.