lib/scripts/fileident
author wenzelm
Sun, 08 Nov 2009 13:44:16 +0100
changeset 33512 771ec7306438
parent 29145 b1c6f4563df7
permissions -rwxr-xr-x
init_component: slightly more robust read (raw input, succeed on non-terminated last line);

#!/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