Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
find(ing) md5sum(ming) awk-formatting in a one liner ...
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
qwertmon...@syberianoutpost.ru  
View profile  
 More options Nov 3 2012, 1:02 pm
Newsgroups: comp.unix.shell
From: qwertmon...@syberianoutpost.ru
Date: Sat, 3 Nov 2012 17:02:38 +0000 (UTC)
Local: Sat, Nov 3 2012 1:02 pm
Subject: find(ing) md5sum(ming) awk-formatting in a one liner ...
 since md5 check sums include the name of the file, you can find and md5sum
files a la:
~
 find . -type f -printf '%Ts,%As,%Cs,"%M",%n,"%u","%g",%s,%d'
 -exec md5sum -b {} \;
~
 the thing is that I am trying to create a csv file so I need to somehow format
md5sum's output as well, but if I try (and tried I have many things ;-)) to use
awk's printf for just the md5sum output it creates all some of problems
apparently related to the bash interpreter and file paths containing spaces for
the find one liner and separately while just using md5sum
~
 you could just go monkey and do things in two runs (which may be faster and
more portable?), but I would like to test the all-in-one run anyway
~
 How do you play with awk's printf to make it print a csv line (after find's
-printf output)?
~
 thanks
 lbrtchx

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jon LaBadie  
View profile  
 More options Nov 3 2012, 6:31 pm
Newsgroups: comp.unix.shell
From: Jon LaBadie <jlaba...@aXcXm.org>
Date: Sat, 03 Nov 2012 18:31:23 -0400
Local: Sat, Nov 3 2012 6:31 pm
Subject: Re: find(ing) md5sum(ming) awk-formatting in a one liner ...
On 11/03/2012 01:02 PM, qwertmon...@syberianoutpost.ru wrote:

First, I would add a trailing comma to your printf.  Otherwise the depth and
the md5sum would be combined.  On my system that yielded output lines that
ended like this:

    ... 1,d41d8cd98f00b204e9800998ecf8427e *./bar

where everything after the "1," comes from md5sum.  I assume you want the
sum as a string (in quotes).  I'd use sed to modify the output:

find . -type f -printf '%Ts,%As,%Cs,"%M",%n,"%u","%g",%s,%d,' -exec md5sum -b {} \; |
sed -e 's/,\(.*\) \*\(.*\)$/,"\1","\2"/'


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »