[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New option for md5sum
From: |
Andreas Schwab |
Subject: |
Re: New option for md5sum |
Date: |
Sat, 19 Apr 2014 09:58:31 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Bernhard Voelker
<address@hidden> writes:
> On 04/19/2014 04:48 AM, Bob Proulx wrote:
>> Rather than cut and using an exact number of characters I prefer to
>> use awk to cut by fields. That way it works with all of the *sum
>> programs.
>>
>> $ md5sum /dev/null | awk '{print$1}'
>
> And there are many other ways:
>
> # using the field option of cut:
> $ md5sum /dev/null | src/cut -d ' ' -f 1
> d41d8cd98f00b204e9800998ecf8427e
>
> $ md5sum /dev/null | sed 's/ .*$//'
> d41d8cd98f00b204e9800998ecf8427e
None of them handle quoted file names:
$ md5sum a\\b | awk '{print$1}'
\d41d8cd98f00b204e9800998ecf8427e
Andreas.
--
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."