lib/scripts/fileident
author wenzelm
Mon, 15 Nov 2010 17:39:23 +0100
changeset 40546 f46c902a8438
parent 29145 b1c6f4563df7
permissions -rwxr-xr-x
eliminated old-style sed in favour of builtin regex matching;

#!/usr/bin/env bash
#
# fileident --- produce file identification based

FILE="$1"

if [ -n "$ISABELLE_FILE_IDENT" -a -f "$FILE" -a -r "$FILE" ]
then
  ID=$(cat "$FILE" | $ISABELLE_FILE_IDENT | cut -d " " -f 1) && echo -n "$ID"
fi