2025-06-08 08:38:00
www.netfort.gr.jp
Introducing the binfmt_misc C scripting interface
“I love C”.
“I enjoy writing in C”.
“I don’t feel well when I have passed a day without coding a line of C”.
“My conversation with my wife simply doesn’t flow without the C language”.
“I want to write everything in C, even the everyday scripting,
but due to the steps required for writing make files and other things,
I tend to choose interpreted languages”.
A good news for the C programmers suffering from these symptoms.
binfmtc is a hack to allow you to use the C language for cases where
script languages such as perl and shell were the languages of choice.
Also included is a “real csh” as an example, allowing you to use the
C language style for executing everyday sysadmin work.
Please experience the real C shell, which has a slightly different
tint to the original C shell we’ve been used to for more than 10 years.
Screenshots
Examples of execution in C, assembly, and C++.
The last entry is the one for real csh.
Usage
Simply add a magic keyword /*BINFMTC: compile-time options
and add execution permission to the C-script.
Every time you invoke the script, the compiler will compile and
execute the program for you.
How to install
For sid add the following line to /etc/apt/sources.list
and do apt-get update; apt-get install binfmtc.
deb http://www.netfort.gr.jp/~dancer/tmp/20050523 ./
Mechanics behind it
By registering magic through Linux binfmt_misc,
binfmtc-interpreter will be invoked every time a C script is invoked.
binfmtc-interpreter will parse the specified script file,
and will invoke gcc with the required options, and compile
to a temporary binary,
and invoke the binary.
Future plans
Do you actually find it, … useful?
gcj support0.3 doneg77 support0.5 donegpc support0.5 done- gnat support
- gobjc support
- chill support
- mono/pnet c# support
use binfmt-supportdone
References
Junichi Uekawa
$Id: binfmtc.html.en,v 1.11 2006/04/16 03:03:16 dancer Exp $
Keep your files stored safely and securely with the SanDisk 2TB Extreme Portable SSD. With over 69,505 ratings and an impressive 4.6 out of 5 stars, this product has been purchased over 8K+ times in the past month. At only $129.99, this Amazon’s Choice product is a must-have for secure file storage.
Help keep private content private with the included password protection featuring 256-bit AES hardware encryption. Order now for just $129.99 on Amazon!
Help Power Techcratic’s Future – Scan To Support
If Techcratic’s content and insights have helped you, consider giving back by supporting the platform with crypto. Every contribution makes a difference, whether it’s for high-quality content, server maintenance, or future updates. Techcratic is constantly evolving, and your support helps drive that progress.
As a solo operator who wears all the hats, creating content, managing the tech, and running the site, your support allows me to stay focused on delivering valuable resources. Your support keeps everything running smoothly and enables me to continue creating the content you love. I’m deeply grateful for your support, it truly means the world to me! Thank you!
BITCOIN bc1qlszw7elx2qahjwvaryh0tkgg8y68enw30gpvge Scan the QR code with your crypto wallet app |
DOGECOIN D64GwvvYQxFXYyan3oQCrmWfidf6T3JpBA Scan the QR code with your crypto wallet app |
ETHEREUM 0xe9BC980DF3d985730dA827996B43E4A62CCBAA7a Scan the QR code with your crypto wallet app |
Please read the Privacy and Security Disclaimer on how Techcratic handles your support.
Disclaimer: As an Amazon Associate, Techcratic may earn from qualifying purchases.