I'd like to pass the result of
mktemp as argument to a command, let's say
gcc -o $(mktemp) causes the result to be used, but I need to figure out the result.
The only thing I could come up with is
gcc -o $(out=$(mktemp); echo $out), but that doesn't print the value to console, but instead it's used as argument value which is correct afaik.
Is there any way to get the result of
mktemp printed to console.
I'm capable to solve this in a script. I'd like to broaden my knowledge with the one-liner solution you hopefully propose.
I'd like to use this in
bash on Ubuntu 19.04.