That is literal, {fd}
isn't a placeholder. I have a script that does this, and does not source in anything, nor does it reference {fd} anywhere else. Is this valid bash?
exec {fd}</dev/watchdog
bashexecio-redirection
That is literal, {fd}
isn't a placeholder. I have a script that does this, and does not source in anything, nor does it reference {fd} anywhere else. Is this valid bash?
exec {fd}</dev/watchdog
Best Answer
Rather than having to pick a file descriptor and hope it's available:
this notation asks the shell to pick a file descriptor that isn't currently in use, open the file for reading on that descriptor, and assign the number to the given variable (
fd
).