help with diff

A Smith asmith9983 at gmail.com
Tue Dec 29 14:37:28 GMT 2009


I'm trying unsuccessfully to use the "--GTYPE-group-format=" option to diff
to try and extract lines  only in file1, not file2, but I must be
mis-understanding the syntax as I only get an option error from diff!

I've written the small script below to test the process:
Thanks for any answers I receive.
--
Andrew


#!/usr/bin/env bash
# Script to test the diff option --GTYPE-group-format=


#!/usr/bin/env bash
# Script to test the diff option --GTYPE-group-format=

set -u
#set -x

dir="/tmp/tst.$$"
mkdir $dir
echo "Created test directory $dir"
# Add a #  in column 1 of the next line to keep the temporary files
trap " rm -vr $dir" STOP EXIT KILL INT

for f in $(seq 1 1 10);do printf "line %d\n" $f;done > $dir/file1
for f in $(seq 1 1 9);do printf "line %d\n" $f;done > $dir/file2
wc -l $dir/*
diff --GTYPE-group-format=\%\< $dir/file1 $dir/file2


More information about the london.pm mailing list