TheDocumentation Index
Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
Use this file to discover all available pages before exploring further.
<> operator is a bidirectional I/O redirection operator that instructs the shell to open a specified file for both reading and writing, assigning it to a specific file descriptor. Unlike standard output redirection (>), it does not truncate an existing file, and the file offset is initialized at the beginning of the file (byte 0). If the target file does not exist, the shell creates it.
Syntax
n: An optional integer representing the file descriptor to be allocated. Ifnis omitted, the shell defaults to file descriptor0(standard input).<>: The read/write redirection operator.word: The target file path. This undergoes standard shell expansions (tilde, parameter, command, arithmetic, and quote removal) before the redirection is executed.
Mechanical Behavior
When the shell encounters this operator, it executes anopen() system call on the target file with the O_RDWR | O_CREAT flags.
- File Descriptor Binding: The opened file is bound to the specified file descriptor
n. Both read and write system calls can subsequently be issued against this single file descriptor. - Pointer Initialization: The internal read/write pointer is set to the absolute beginning of the file.
- Non-Destructive Open: Because the
O_TRUNCflag is omitted, pre-existing data within the file is preserved. Any subsequent write operations will overwrite existing bytes sequentially from the current pointer position, rather than clearing the file beforehand. - Creation: If the file specified by
worddoes not exist, it is created using the default permissions, subject to the current shellumask.
Execution Context
exec builtin, the redirection modifies the file descriptors of the current shell environment. When appended to a standard command, the redirection is scoped exclusively to the execution environment of that specific command, closing the file descriptor immediately after the command terminates.
Master Bash with Deep Grasping Methodology!Learn More





