On Sun, Nov 03, 2019 at 11:09:00AM -0800, Darrick J. Wong wrote: > > Because if you don't do that, the e2scrub process gets started with fd 0 > mapped to stdout of ls_targets on account of the "ls_targets | while > read tgt" loop. Yay bash. I guess the problem here is that > e2scrub_all's stdin is itself a pipe, so /dev/stdin maps to > /proc/self/fd/0, is a symlink to "pipe:[XXXX]" which doesn't help us > any. > > We could amend the e2scrub_all script to do: > > stdin="$(realpath /dev/stdin)" > test -w "${stdin}" || stdin=/dev/null
Shouldn't that be 'test -r "${stdin}"'? Or we could just always redirect the input to /dev/null, perhaps? Cheers, - Ted