Package: dash
Version: 0.5.12-6
Severity: normal
Tags: upstream

dash supposedly implements test s1 < s2 and test s1 > s2 for string
comparisons. A cursory glance at [0], [1] and [2] seems to confirm this.

Anyway the shell redirection seems to take precedence so that the test
is not actually performed.

> dash
$ type test
test is a shell builtin
$ ls -l bar
ls: cannot access 'bar': No such file or directory
$ test "foo" < "bar"
dash: 2: cannot open bar: No such file
$ test "foo" > "bar"
$ ls -l bar
-rw-r--r-- 1 gpiero gpiero 0 Sep  2 12:51 bar

As a side note, '<' and '>' are not mandated by POSIX [3].

Thanks,
Gian Piero.

[0] https://git.kernel.org/pub/scm/utils/dash/dash.git/tree/src/dash.1
[1]
https://git.kernel.org/pub/scm/utils/dash/dash.git/tree/src/bltin/test.1
[2]
https://git.kernel.org/pub/scm/utils/dash/dash.git/tree/src/bltin/test.c
(STRLT and STRGT)
[3] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html


-- System Information:
Debian Release: trixie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.19.0-1-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: OpenRC (via /run/openrc), PID 1: init
LSM: AppArmor: enabled

Versions of packages dash depends on:
ii  debianutils  5.11
ii  dpkg         1.22.0
ii  libc6        2.37-7

dash recommends no packages.

dash suggests no packages.

-- no debconf information

Reply via email to