Results 1 - 6 of about 6 results out of about 107589 pages. (0.02 seconds)
- ParsingLs . . . 1 match
- ...d-splitting and globbing here, same mistake as above.
}}}
See BashPitfalls and DontReadLinesWithFor for more details.
Things get more difficult if you wanted some specific sortin...
- CategoryShell . . . 1 match
- ...##master-page:CategoryTemplate
##master-date:Unknown-Date
#format wiki
#language en
These pages discuss issues associated with the Unix command line shells, especially bash, but a...
- BashPitfalls . . . 1 match
- .... For example:
{{{
IFS=$'\n'
for line in $(cat file); do … # Wrong!
}}}
[[DontReadLinesWithFor|This doesn't work]]! Especially if those lines are filenames. Bash (or any ot...
- BashGuide/Practices . . . 1 match
- ...le`, `tr ' ' '\n' < /my/file`, ...).
* '''`for line in $(<file); do`'''
. [[DontReadLinesWithFor|Don't use a for loop]] to read the lines of a file. Use a [[BashFAQ/001|while ...
- BashFAQ/005 . . . 1 match
- ...\n' read -rd '' -A lines <file
}}}
===== Don't read lines with for! =====
'''[[DontReadLinesWithFor|Never read lines using for..in loops]]!''' Relying on [[IFS]] WordSplitting cau...
- BashFAQ/001 . . . 1 match
- ... read a file (data stream, variable) line-by-line (and/or field-by-field)? ==
[[DontReadLinesWithFor|Don't try to use "for"]]. Use a `while` loop and the `read` command. Here is ...