-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC3022
Vidar Holen edited this page Sep 8, 2020
·
1 revision
(or "In dash, ... is not supported." when using dash
)
exec {n}> "$output"
echo "Your fd is $n"
There is no simple, mechanical alternative for POSIX sh, but you can either switch to a shell that does support this (like bash
), or hard code (or eval
) a specific file descriptor.
The syntax for opening an arbitrary file descriptor and assigning it to a variable for later use is a bash
and ksh
extension. It does not work on POSIX sh or dash
.
None
- Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!