Home > Mobile >  Application type of .Z file type
Application type of .Z file type

Time:01-15

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.

CodePudding user response:

Maybe because that's not what file says? I get application/x-compress for .Z files.

  •  Tags:  
  • Related