bash - Open a filedescriptor specified by a variable -


i open file descriptor like:

exec 3> /path/to/file

where actual file descriptor number in variable:

fd=3 exec $fd> /path/to/file 

unfortunately not work:

bash: exec: 3: not found 

is there way bash?

you'll need use eval:

fd=3 file=/path/to/file  eval "exec $fd> $file" 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -