bashsupport-pro icon indicating copy to clipboard operation
bashsupport-pro copied to clipboard

Support dynamic file descriptor variables

Open chrko opened this issue 1 year ago • 2 comments

I had the need to just get the next free FD for a flock call, and the following is actually a thing you can do (cmp. https://stackoverflow.com/a/41620630):

exec {flock_fd}>"${flock_file}"
flock "${flock_fd}"
# […]
exec {flock_fd}>&-

Currently the plugin marks the usage of the variable flock_fd as "referenced but not assigned".

chrko avatar Jul 30 '24 16:07 chrko