#!/bin/sh

FILE=$1
ID_NAME=$2

if [ "$ID_NAME" = "" ]; then
  echo "[USAGE]"
  echo "$0 filename id_name"
  exit
fi

AWK_ARG=`sh get_awk-args.sh`

cat $FILE | tr -d '\r' | awk $AWK_ARG '{ \
  p0=match($0, /[^a-zA-Z0-9_-]modern[^a-zA-Z0-9_-]/); \
  if ( 0 < p0 ) { \
    printf("%s%s%s\n", substr($0,1,p0+1-1), "'$ID_NAME'", substr($0,p0+1+6)); \
  } else { \
    printf("%s\n",$0); \
  } \
}'

