#!/bin/sh
# this file is in the public domain

which gsed >/dev/null 2>/dev/null && alias sed=gsed

if [ -f $2/${1%fs}i ]
then
    execs="$(grep '^// exec:' $2/${1%fs}i | cut -f3- -d' ')"
else
    if [ -f ${1%fs}i ]
    then
	execs="$(grep '^// exec:' ${1%fs}i | cut -f3- -d' ')"
    fi
fi

if [ -z "$execs" ]
then
    cat
else
    eval "$execs"
fi
