I am new to shell, I have a case where I am trying to evaluate a particular column unique values to check if they are valid in a shell script which will be invoked later.
From my searches I think cut along with sort & unique is good to do it
So my attempt is
file=/filepath/*vendor.csv
file_categories = `cut -d, -f1 $file |sort |unique`
$file should hold file which has vendor in its filename
but even after using command substitution (`) the $file is not getting replaced with the correct filename , it just places what is present in file
Another example for what I am attempting is
a=/stage/scripts/vendor/*.out
echo $a
/stage/Scripts/ecommerce/oneclick/nohup.out /stage/Scripts/ecommerce/Vendor/Vendor_Automate_Ingestion_Process.out
wc-l
wc: /stage/Scripts/ecommerce/vendor/*.out:
$(wc -l "$a")
wc: /stage/Scripts/ecommerce/vendor/*.out:No such file or directory
I want to understand how we can pass wild characters in command substitution and what I can do to rectify.