I need to create some (small) temporary files in my zsh scripts, and I want them to live on RAM so as to avoid disk IO. What are the idiomatic ways of doing this? I want it to work on Linux and macOS, though, of course, I can just handle them with a conditional.
The best solution I have found thus far is creating a ramfs (https://stackoverflow.com/questions/46224103/create-apfs-ram-disk-on-macos-high-sierra). This works, but needs setup on the machine which I prefer to avoid.
PS: The only usecase I have in mind currently is capturing stdout and stdin in different variables, but I believe I’ll find other use cases as well in time.