dylanaraps / pure-sh-bible

📖 A collection of pure POSIX sh alternatives to external processes.
MIT License
6.45k stars 281 forks source link

shift and read #13

Closed Ypnose closed 4 years ago

Ypnose commented 4 years ago

Hi there, I would like to let you know that dash (0.5.10.2 here) does not crash anymore with shift and read examples :

$ cat snip
#!/bin/sh

shift
$ dash snip
snip: 3: shift: can't shift that many
$ cat snip
#!/bin/sh

read -r
$ dash snip
snip: 3: read: arg count
dylanaraps commented 4 years ago

Nice, good to know. I'll update the bible shortly.

spiralofhope commented 4 years ago

I have also tested the examples by @Ypnose and they do not crash for Debian 10.1.0-amd64-xfce-CD-1 updated just the other day. Keeping those workarounds (in another document) may be important for historical reference / users of earlier versions.

apt-cache showpkg dash
Package: dash
Versions: 
0.5.10.2-5 (/var/lib/apt/lists/ftp.ca.debian.org_debian_dists_buster_main_binary-amd64_Packages) (/var/lib/dpkg/status)
 Description Language: 
                 File: /var/lib/apt/lists/ftp.ca.debian.org_debian_dists_buster_main_binary-amd64_Packages
                  MD5: 8d4d9c32c6b2b70328f7f774a0cc1248
 Description Language: en
                 File: /var/lib/apt/lists/ftp.ca.debian.org_debian_dists_buster_main_i18n_Translation-en
                  MD5: 8d4d9c32c6b2b70328f7f774a0cc1248

Reverse Depends: 
  apt-move,dash
  libguestfs0,dash
  hibernate,dash
  dphys-config,dash
  ash,dash
Dependencies: 
0.5.10.2-5 - libc6 (2 2.14) debianutils (2 2.15) dpkg (2 1.19.1) debconf (18 0.5) debconf-2.0 (0 (null)) 
Provides: 
0.5.10.2-5 - 
Reverse Provides: