Questions tagged [interpreter]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
3answers
33 views

bash line interpreting process

I would like to understand the exact process of line interpretation executed by bash. from GNU bash reference manual: When a simple command is executed, the shell performs the following expansions, ...
0
votes
0answers
34 views

Shebang interpreted incorrectly [duplicate]

I had this weird problem where my shebang is not interpreted correctly for one particular python file. It works well with all my other scripts. The error code looks like this: -bash: myfile.py: /usr/...
2
votes
0answers
54 views

How to trace script execution events

My goal: To receive events from the kernel when a file/script is opened for execution with the absolute path of the file (or maybe the working directory, to resolve the absolute path of the file). I ...
2
votes
1answer
166 views

Why “ >/dev/console” for remote beep (echo-command)

I've learned that this command: echo -e "\a" triggers a beep on the local system, whereas this command: echo -e "\a" >/dev/console triggers a beep on a remote system. Why is this? What is the &...
4
votes
3answers
204 views

Who runs the interpreter for files that are execute-only?

If the current user only has execute (--x) permissions on a file, under which user does the interpreter (specified by #!/path/to/interpreter at the beginning of the file) run? It couldn't be the ...
0
votes
1answer
83 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
299 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, ...
1
vote
1answer
773 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
737 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
5k 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 ...
7
votes
6answers
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 ...
5
votes
2answers
7k 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
518 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
793 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?