Hey Folks,
I was writing a script for someone on the Keyboard Maestro forum:
cd ~/Downloads/; unzip -qq FL_insurance_sample.csv.zip; sleep 0.25; open -a 'Microsoft Excel' 'FL_insurance_sample.csv'
Nothing too fancy.
I don't often fool with zip or unzip from the shell, but this really surprised me.
When I was testing I needed to run the script again, and unzip asked me if I wanted to replace the ._FL_insurance_sample.csv file.
Eh?
I said OK and let it thinking it was trying to replace the primary FL_insurance_sample.csv file (which I'd already deleted).
It took me a couple of tries before I realized there was something invisible in the works, so I took a quick look with the Terminal.
I noticed the zip resource folder __MACOSX, which was "hiding" at the top of my downloads folder, so I fired up ForkLift and switched on Show Invisible Items for a better look.
~/Downloads/ __MACOSX/ <-- Visible ._FL_insurance_sample.csv <-- Invisible FL_insurance_sample.csv
Unzip is not cleaning up after itself and is leaving this orphan folder with an invisible file sitting there.
That seems like misbehavior to me.
Am I missing something? An option in unzip perhaps?
I can of course test for this junk in my script and delete it if necessary, but this surely falls out of the it just works category.
TIA
|