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: Michael Stone
Subject: Re: [PATCH] md5sum,b2sum,sha*sum: support -s option
Date: Mon, 25 Jun 2018 10:25:48 -0400
User-agent: NeoMutt/20170113 (1.7.2)

On Mon, Jun 25, 2018 at 12:23:29AM -0300, Carlos Santos wrote:
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

Can't you just skip both options and direct output to /dev/null?

Mike Stone



reply via email to

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