Welcome to DU! The truly grassroots left-of-center political community where regular people, not algorithms, drive the discussions and set the standards. Join the community: Create a free account Support DU (and get rid of ads!): Become a Star Member Latest Breaking News Editorials & Other Articles General Discussion The DU Lounge All Forums Issue Forums Culture Forums Alliance Forums Region Forums Support Forums Help & Search

PoliticAverse

(26,366 posts)
1. The reason hexdump * | head -4 > <filename> didn't work...
Sat Oct 17, 2015, 11:54 PM
Oct 2015

is because it piped the output of the entire first command "hexdump *" into "head -4" not the
output of each hexdump one at a time.

You need a short shell script, like:

#!/bin/bash
for f in $*
do
echo -n $f " " >> output.txt
hexdump $f | head -4 >> output.txt
done

Recommendations

0 members have recommended this reply (displayed in chronological order):

Latest Discussions»Culture Forums»Open Source and Free Software»Need some really Unix-y h...»Reply #1