dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* dash & IFS
@ 2020-03-23  8:20 n8dandy
  2020-03-23  8:44 ` Harald van Dijk
  0 siblings, 1 reply; 3+ messages in thread
From: n8dandy @ 2020-03-23  8:20 UTC (permalink / raw)
  To: dash

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-25  7:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-23  8:20 dash & IFS n8dandy
2020-03-23  8:44 ` Harald van Dijk
2020-03-25  7:08   ` n8dandy

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).