From: n8dandy <n8dandy@protonmail.com>
To: "dash@vger.kernel.org" <dash@vger.kernel.org>
Subject: dash & IFS
Date: Mon, 23 Mar 2020 08:20:23 +0000 [thread overview]
Message-ID: <dDYpzKRWD9p1jhFjsIjWZvAddv8e0CQYDq1UxXsV33DN8SvAxPj9gOakBk9LBcTu6j_qEZLUTIoebSKq3-yQ4LKNjGZG-jk-SMMy_RGE-hI=@protonmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]
Good morning,
Few days ago, I noticed something strange with dash and IFS. It was
verified with the following versions :
- 0.5.10.2 on Voidlinux
- 0.5.10.2 on Debian Buster
- 0.5.8 on Ubuntu 18.04.2 LTS (Bionic Beaver)
Here the issue :
$ ls
file.sign file1 file2 other.sign whileifs*
$ cat whileifs
#!/bin/dash
find . -type f | sort -d | while IFS=$'\n' read -r F; do
printf "%s\n" "$F"
done
$ ./whileifs
./file1
./file2
./file.sig
./other.sig
./whileifs
file.sig and other.sig are returned instead of file.sign and other.sign.
Here the result with bash :
$ bash whileifs
./file1
./file2
./file.sign
./other.sign
./whileifs
Here the result with mksh :
$ mksh whileifs
./file1
./file2
./file.sign
./other.sign
./whileifs
Here the result with lksh :
$ lksh whileifs
./file1
./file2
./file.sign
./other.sign
./whileifs
Here the result with busybox ash (1.31.0) :
$ /tmp/busybox-x86_64 ash whileifs
./file1
./file2
./file.sign
./other.sign
./whileifs
I attached the test directory. Can you reproduce it ?
Sincerely
Y
[-- Attachment #2: dashifs.tar.gz --]
[-- Type: application/gzip, Size: 318 bytes --]
next reply other threads:[~2020-03-23 8:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-23 8:20 n8dandy [this message]
2020-03-23 8:44 ` dash & IFS Harald van Dijk
2020-03-25 7:08 ` n8dandy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='dDYpzKRWD9p1jhFjsIjWZvAddv8e0CQYDq1UxXsV33DN8SvAxPj9gOakBk9LBcTu6j_qEZLUTIoebSKq3-yQ4LKNjGZG-jk-SMMy_RGE-hI=@protonmail.com' \
--to=n8dandy@protonmail.com \
--cc=dash@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).