Bash process substitution with temporary file

bashprocess-substitutionshelltmp

Some programs needs their files to be seekable, for example objdump does.

$ objdump -D -b binary -m i8086 <(echo 0xea 0x5b 0xe0 0x00 0xf0|xxd -r -p)
objdump: Warning: '/proc/self/fd/11' is not an ordinary file

It would be convenient to have process substitution use temporary files.

I can see in the man page that bash can fallback to temporary files with process substitution, but can I explicitly ask him to use temporary files?

Like zsh's =().

$ objdump -D -b binary -m i8086 =(echo 0xea 0x5b 0xe0 0x00 0xf0|xxd -r -p)

/tmp/zsh1u1Nrw:     file format binary


Disassembly of section .data:

00000000 <.data>:
   0:   ea 5b e0 00 f0          ljmp   $0xf000,$0xe05b

Best Answer

Based on meuh's comment; apparently bash here-strings can be abused as temporary files, try this:

( echo 0xea 0x5b 0xe0 0x00 0xf0 | 
  xxd -r -p >/dev/fd/9; objdump -D -b binary -m i8086 /dev/fd/9) 9<<<''