Journal JDWTopGuy's Journal: Even more pathetic... 11
The boredom meter was hitting dangerous levels again, so I turned the C program I posted in my last JE into a self-compiling, self-running program.
Basically, wrote a simple bash script that extracts the C program from itself (tail -n 17 $0 > tmp.c), then compiles the program, removes the temporary file, and runs the C program.
Isn't that thrilling?
Sounds like you're having fun. (Score:2)
Re:Sounds like you're having fun. (Score:1)
Re:Simple ... (Score:2)
I think I'll implement the non-pointer one. I want portable, pointer-free code.
Re:Simple ... (Score:2)
Get an account, dude.
The difference between your shell script and mine is, mine saves the executable, doesn't use a temporary directory, and it uses the CC environment variable (defaulting to GCC if it's empty).
I'd post it but I'm too lazy.
Re:Simple ... (Score:2)
Re:Shell Scripting 101 (Score:2)