redirection
Bash read/write redirection
Open for both reading and writing without truncation; may create missing file. Defaults to descriptor 0.
Formal Syntax & Structure
bash syntaxbash
[n]<>fileReturn Value
redirection effect
Open for both reading and writing without truncation; may create missing file. Defaults to descriptor 0.
Working Example
Example Snippetbash
printf 'abc\n' > sample.txtexec 3<>sample.txtprintf X >&3exec 3>&-cat sample.txt