Issue
I'm trying to find the application type in order to figure if a file is a 'compressed' file using the File command. The compress files have the .Z file type, and I want to catch it using the ' case ... in ' method. An example for catching gunzip files will be the following:
case $(file --mime-type -b "$myFile") in
application/gzip)
echo "gunzip $myFile" ;;
I've tried doing this:
application/ncompress)
echo "uncompress $myFile" ;; # NOT WORKING
But it does not work.
Solution
Maybe because that's not what file says? I get application/x-compress
for .Z files.
Answered By - Mark Adler Answer Checked By - Gilberto Lyons (WPSolving Admin)