coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] md5sum,b2sum,sha*sum: support -s option


From: Carlos Santos
Subject: Re: [PATCH] md5sum,b2sum,sha*sum: support -s option
Date: Mon, 25 Jun 2018 00:23:29 -0300 (BRT)

> From: "Pádraig Brady" <address@hidden>
> To: "DATACOM" <address@hidden>, "Coreutils" <address@hidden>
> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]