Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [interpreter]

The tag has no usage guidance.

2
votes
0answers
578 views

IndentationError when pasting code in Python 3 interpreter mode [migrated]

When I was running the following code, which has blank lines (no space) inside functions, I got different behavior from Python 3.6.5 when running the code line by line in interpreter mode and python3 ...
0
votes
1answer
37 views

What's the purpose of having “env [shell]” as an interpreter? [duplicate]

I already stumbled over #!/usr/bin/env bash on numerous occasions and never questioned it. Now, I'm wondering what the purpose of wrapping the shell interpreter in an env command, i.e. why not just ...
7
votes
3answers
287 views

Is parsing scripts at script-runtime ubiquitous to shells or present in other interpreters and how does that work?

I had always thought that shells parse whole scripts, constructing an AST, and then execute that AST from memory. However, I just read a comment by Stéphane Chazelas, and tested executing this script, ...
0
votes
1answer
452 views

Building “cross linux system” programs, with different libc/musl interpreter

My goal is simple: I would like to create a program that bootstraps the nix package manager on any architecture, as a non-root user, with as few depends as possible. For now, what I did is the ...
3
votes
2answers
509 views

xslt shbang: Using xslt from the command line

I have (foolishly?) written a couple of moderately general-purpose xslt scripts. I'd quite like to turn these into executables that read an xml document from standard in or similar. The way you do ...
16
votes
6answers
3k views

Choose interpreter after script start e.g. if/else inside hashbang

Is there any way to dynamically choose the interpreter that's executing a script? I have a script that I'm running on two different systems, and the interpreter I want to use is located in different ...
6
votes
5answers
3k views

Run program at lower CPU speed?

It would be very useful for me to run specific programs in a Linux environment with a fixed (lower) CPU clock speed (say, runat 400mhz ./my-program --argument-of="my program" for getting that clock ...
6
votes
1answer
1k views

Perl and Python wrongly interpreted via shebang on Linux

All my Python and Perl scripts are simply NOT iterpreted via shebang. Never. But they work as expected when I explicitly call the binary. I double checked my Perl and Python installations, it is ...
4
votes
2answers
6k views

Specifying a generic interpreter for a program like expect?

I am writing expect script which can be used on mulple operating systems but the problem is i can't use #!/usr/bin/expect evreywhere so instead i tried to do #!`which expect` at the top but it ...
0
votes
2answers
488 views

can something besides the shebang set the interpreter? [closed]

I'm running a script (in tmuxinator) that tries to source another script (rvm). rvm explicitly does not allow sourcing from sh. I didn't think that would be a problem, because the shebang in the ...
1
vote
3answers
730 views

Is shebang always the same as the interpreter's installation directory?

Must the shebang header always match the interpreter's installation directory? If so, then why do both #!/usr/bin/python and #!/usr/local/bin/python work for me?