Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.bugs.dist > #1136020
| From | Petter Reinholdtsen <pere@hungry.com> |
|---|---|
| Newsgroups | linux.debian.bugs.dist |
| Subject | Bug#1030316: [Pkg-zfsonlinux-devel] Bug#1030316: trim script always exits 1 despite not failing |
| Date | 2023-02-02 20:50 +0100 |
| Message-ID | <FUNKN-2XUr-5@gated-at.bofh.it> (permalink) |
| References | <FUNrs-2XNO-13@gated-at.bofh.it> <FUNrs-2XNO-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Scott Colby] > I believe this is caused by the final command of the script being > `zpool list ... | while read -r pool do ...; done`. When the output > of `zpool list` is exhausted, `read` returns an error, and thus the > script exits with that status. I have confirmed this by running the > script with `sh -x` and seeing that the last output line is > `+ read -r pool`. This sound strange. It is not according to my understanding of bourne shell scripting, and this oneliner describe how I believe it work: % ((set -x; echo foo|while read a; do a=$a; done); echo $?) + echo foo + read a + a=foo + read a 0 % -- Happy hacking Petter Reinholdtsen
Back to linux.debian.bugs.dist | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Bug#1030316: trim script always exits 1 despite not failing "Scott Colby" <debian@scott.scolby.com> - 2023-02-02 20:30 +0100
Bug#1030316: [Pkg-zfsonlinux-devel] Bug#1030316: trim script always exits 1 despite not failing Petter Reinholdtsen <pere@hungry.com> - 2023-02-02 20:50 +0100
Bug#1030316: [Pkg-zfsonlinux-devel] Bug#1030316: trim script always exits 1 despite not failing "Scott Colby" <debian@scott.scolby.com> - 2023-02-02 21:00 +0100
csiph-web