On Aug 23 2023, Greg Wooledge wrote: > Then again... leaving an FD open in a shell script usually won't matter, > because the script will exit, and that'll just take care of it. The > only times it actually matters are long-running bash processes -- either > interactive shells, or some kind of weird daemon that's been implemented > in bash for some reason -- or scripts that open and (fail to) close lots > of temp FDs in a loop.
It will also cause the open FD to be passed to all subsequent commands, and keeps a reference to the underlying file, which may affect EOF processing if the file is a pipe. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."