case passthru
David Henderson
dhenderson at digital-pipe.com
Thu Feb 18 19:26:09 UTC 2016
On 2/18/16, Bastian Bittorf <bittorf at bluebottle.com> wrote:
> * David Henderson <dhenderson at digital-pipe.com> [18.02.2016 17:14]:
>> case "$(cat /tmp/md5.txt)" in
>> '123456')
>> ...implement updates for this particular version...
>> ;;
>> '234567')
>> ...implement updates for this particular version...
>> ;;
>> esac
>
> this is not POSIX and you can work around with e.g.:
>
> #!/bin/sh
> while read -r CRC; do
> case "$CRC" in
> '1234')
> ...
> ;;
> '5678')
> ...
> ;;
> esac
> done </tmp/md5.txt
I figured it wasn't POSIX since the only exceptions I could find dealt
with bash or zsh, but thanks for the work around!
Dave
More information about the busybox
mailing list