I can paste the contents of a file into a command using cat and backticks:ls `cat filenames`Is there a way to do the reverse - to turn a string into a (temporary) filename?gcc -o cpuburn `uncat main(){while(1);}`.c
Is there a command which creates a temporary file containing the arguments passed to it?
shell;command line;files;tmp
You can pass the source code on gcc's standard input. Since gcc isn't given a file name, you need the -x option to let it know what the output language is. You can pass input via a here string (most convenient for a single line), a here document, or a pipe.gcc -o cpuburn -x c - <<<'main(){while(1);}'If you need a file name on the command line, you can use process substitution to generate the content. That doesn't give you control over the file name (it'll be something like /dev/fd/42).gcc -o cpuburn -x c <(echo 'main(){while(1);}')If you really need control over the temporary file's name, you'll need something more complex where you manually create and remove the temporary file.src=$(mktemp XXXXXXXXXX.c)trap 'rm $src' EXIT INT TERM HUPecho 'main(){while(1);}' >$srcgcc -o cpuburn $src(This answer assumes that your shell is bash, zsh or ksh93.)