#!/bin/bash
file_name = $1
ext = (file -b --mime-type $file_name | sed 's/application\///g')
echo $file_name $ext
Following error messages are seen while executing the code:
file_extractor.sh: line 3: file_name: command not found
file_extractor.sh: line 4: ext: command not found
I have tried adding quotes to the variable, file_name = "$1"
didn't work,
then substituting $(file -b --mime-type $file_name | sed 's/application\///g')
, using double quotes.
Nothing worked.