I want to verify the file is Binary or ascii file and accordingly I want to switch the program with ret code
ie 0 or success and 1 for failure
Can any one help me is this a correct syntex...i am getting error
#!/bin/ksh
$file filename
if [ $? -eq 'ascii' ]
echo "ascii fie Found"
else
echo " binary file not Found"
fi
EXAMPLES
Example 1: Binary executable files
Determine if an argument is a binary executable file:
file "$1" | grep -Fq executable &&
printf "%s is executable.\n" "$1"