#!/bin/bash
echo $1 "is:"
if [ $(which $1 | wc -l) -eq "1" ]
then
echo program $(which $1)
fi
if [ $(type $1 2>/dev/null | grep -o "aliased.*" | wc -l) -eq "1" ]
then
echo $(type $1 | grep -o "aliased.*")
fi
if [ $(cat $1 2>/dev/null | fold --width=2 | sed '1!D' | grep "#!" | wc -l) -eq "1" ]
then
echo script
fi
count=$( echo $(cat $1 2>/dev/null | fold --width=2 | sed '1!D' | grep "#!" | wc -l)+$(type $1 2>/dev/null | grep -o "aliased.*" | wc -l)+$(which $1 | wc -l) | bc )
if [ "$count" -eq "0" ]
then
echo other
fi