3 ms·
This isn't portable though, it's a GNU-specific "smart" things. Elsewhere, this overwrites the target device file.
by WhyNotHugo 11d ago
This isn't portable though, it's a GNU-specific "smart" things. Elsewhere, this overwrites the target device file.
- jasomill 11d agoRedirection doesn't overwrite device files, so cat foo.img > /dev/sda works and should be portable. No control over the buffer size, though.
- LtWorf 10d agoAnd no printing of progress either.
- akdev1l 11d agoHow exactly is cp not portable? Whatever behaviour you’re describing is not how POSIX mandates cp to work. In fact you can do this with busybox too. cp will open("/dev/sda", O_WRONLY | O_TRUNC) and simply start writing to that file descriptor.
- deleted 11d ago[deleted]