bin bash echo is if which wc -l -eq then echo program which fi if type

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/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