#!/usr/local/bin/perl

# 
# cominfo: コマンドスクリプトファイルのヘッダ情報を出力する．
# 
#     [1996/12/06] OSHIRO Naoki.
# 
#     $Log:$
#

$path=`which $ARGV[0]`;
if ($path=~/: Command not found./) {
	print $path;
	exit;
}
$type=`file $path`;
unless ($type=~/script$/) {
	print $type;
	exit;
}

chop($path);
print ">>> $path\n";
open(F, "<$path");
while (<F>) {
	last unless /^\s*([#%].*)?$/;
	print;
}
close(F);
