I've wondered this many times and in many cases, and I like to learn so general or close-but-more needed answers are acceptable to me.
I'll get specific, to help explain the question. Please remember that this question is more about accelerating common interpreted language calls (yes, exactly the same arguments), than it is about the specific programs I'm calling in this case.
Here we go:
Using i3WM I use i3lock-fancy to lock my workspace with a key-combo mapped to the command:
i3lock-fancy -p -f /usr/share/fonts/fantasque_mono.ttf
So here is why I think this is possible, though my google-fu has failed me:
- i3lock-fancy is a bash script, and bash is an interpreted language
- each time I run the command I call it with the same arguments
- Theoretically the interpreter is spitting out the same bitstream to be executed, right?
Please don't complain about portability, I understand it, the captured bitstream, would not be
For visual people: When I call the above command > bash interpreter converts bash-code to byte-code > CPU executes byte-code
I want to: execute command > bash interpreter converts to byte-code > save to file
so that I can effectively skip interpretation (since it's EXACTLY the same every time): call file > CPU executes byte-code
What I tried:
Looking around on SO before asking the question lead me shc
which is similar in some ways to what I'm asking for.
But this is not what shc
is for (thanks @stefan)
is there a way to do this which is more like what I've described? Simply put, is there a way to interpret bash, and save the result without actually running it?