bash:files:read_a_file:read_fields_from_a_file
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
bash:files:read_a_file:read_fields_from_a_file [2021/01/26 13:43] – peter | bash:files:read_a_file:read_fields_from_a_file [2021/01/26 13:44] (current) – [Field splitting, white-space trimming, and other input processing] peter | ||
---|---|---|---|
Line 99: | Line 99: | ||
</ | </ | ||
- | |||
- | ---- | ||
- | |||
- | ====== Field splitting, white-space trimming, and other input processing ====== | ||
- | |||
- | When not to use the **-r** option: | ||
- | |||
- | * **-r**: | ||
- | * Without this option, any unescaped backslashes in the input will be discarded. | ||
- | * You should almost always use the **-r** option with read. | ||
- | |||
- | The most common exception to this rule is when **-e** is used, which uses Readline to obtain the line from an interactive shell. | ||
- | |||
- | * In that case, tab completion will add backslashes to escape spaces and such, and you do not want them to be literally included in the variable. | ||
- | * This would never be used when reading anything line-by-line, | ||
- | |||
---- | ---- | ||
bash/files/read_a_file/read_fields_from_a_file.1611668596.txt.gz · Last modified: 2021/01/26 13:43 by peter