Just by coincidence I had to use my ATA-ID-to-device-name script (found here: https://serverfault.com/questions/244944/linux-ata-errors-translating-to-a-device-name/426561#426561) on a read-only /
partition. In case you're curious, it was an Ubuntu recovery console which will let you access your /
partition, but will mount it read-only by default. I am glad about that, because otherwise I would probably never have found out that my script behaves strangely on a R/O system due to a specific line, this one:
IFS=: read HostMain HostMid HostSub <<< "$HostFull"
This does not work if there is no write permission. I wouldn't have assumed it would fail, though. But apparently the <<<
operator does require to write some temporary file to somewhere.
But is there any way to circumvent the creation of a temporary file, or, is there any way to specify where the file is written to? In the Ubuntu recovery console, there is---oddly enough---write permission on the /run
directory, so that would do, if I could somehow "tell" read
to write the temp file to somewhere else than usual.
/dev/fd
has nothing to do with this.<<<
is the culprit though, because it creates a temporary file (which needs to be written somewhere). – Gilles 'SO- stop being evil' Nov 02 '13 at 23:59