> From: "Pádraig Brady" <[email protected]>
> To: "DATACOM" <[email protected]>, "Coreutils" <[email protected]>
> Sent: Monday, June 25, 2018 12:09:28 AM
> Subject: Re: [PATCH] md5sum,b2sum,sha*sum: support -s option
> On 24/06/18 20:00, Carlos Santos wrote:
>> Add an alias to --status matching the "-s" option recognized by BusyBox.
>> It helps to interchange scripts between full-fledged Linux distributions
>> and embedded systems on which BusyBox is used instead of coreutils.
>
> It looks like busybox doesn't support any long options?
Right.
> Why is this one in particular important?
I stumbled on it when attempted to write a script that uses sha256sum
and needs to work both on Fedora 7 and on an embedded system built with
Buildroot. It's necessary to test where sha256sum comes from and use a
variable for the status argument:
if sha256sum --help 2>&1 | fgrep -q BusyBox; then
s_arg="-s" # BusyBox
else
s_arg="--status" # coreutils
fi
echo "${checksum} ${img_file}" | sha256sum -c "${s_arg}" -w
--
Carlos Santos (Casantos) - DATACOM, P&D
“Marched towards the enemy, spear upright, armed with the certainty
that only the ignorant can have.” — Epitaph of a volunteer