Revision 9127
Added by Aaron Marcuse-Kubitza over 11 years ago
util.sh | ||
---|---|---|
323 | 323 |
|
324 | 324 |
# convention: use fd 10/11/12 for command-specific alternate stdin/stdout/stderr |
325 | 325 |
|
326 |
# allow commands to access global stdin/stdout/stderr using fd 20/21/22 |
|
327 |
# this works even when /dev/tty isn't available |
|
328 |
# ignore errors if a source fd isn't open |
|
329 |
prefix=2 |
|
330 |
src=0 dir='<' shadow_fd || true |
|
331 |
src=1 dir='>' shadow_fd || true |
|
332 |
src=2 dir='>' shadow_fd || true |
|
333 |
unset prefix |
|
326 | 334 |
|
335 |
|
|
327 | 336 |
#### vars |
328 | 337 |
|
329 | 338 |
set_var() { eval "$1"'="$2"'; } |
Also available in: Unified diff
lib/sh/util.sh: streams: allow commands to access global stdin/stdout/stderr using fd 20/21/22. this works even when /dev/tty isn't available.