Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro Newsgroups: comp.unix.shell Subject: IFS=$'\n' Date: Tue, 13 Aug 2024 08:26:41 -0000 (UTC) Organization: A noiseless patient Spider Lines: 23 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 13 Aug 2024 10:26:41 +0200 (CEST) Injection-Info: dont-email.me; posting-host="dcc5997f875115997406f45b29a1ceee"; logging-data="4007222"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Um9kI9EH0A8g53UQ5FpDu" User-Agent: Pan/0.159 (Vovchansk; ) Cancel-Lock: sha1:pZEtGWaKjxcO2MIo+WACZyamcOU= Bytes: 1633 I like having spaces in file/directory names, but I avoid putting newlines in them. This plays havoc with the shell’s word-splitting rules, because the default value for IFS is IFS=$' \t\n' which means names with spaces in them get split into separate items, triggering lots of errors about items not found (or the wrong items found/ created). However, if you change this to IFS=$'\n' then this can make things much more convenient (provided you can be sure there are no newlines in your file names). For example, I can do ls -lt $(find . -type f -iname \*fred\*) to search for all filenames containing “fred” in the hierarchy rooted at the current directory, and display them in reverse chronological order.