DEV Community

Discussion on: Bash scripting for everyday actions

Collapse
 
carminezacc profile image
Carmine Zaccagnino • Edited

I tested the script and had two versions of it at some point (one in the body of the text and one I was executing), I must have left snippets of the wrong one in, you're correct, I'll fix it right now, thank you very much for noticing that.
P.S.: The issue with spaces around the assignment is in the first part of the post, I didn't pay as much attention to that as I should have and I usually leave spaces intentionally around operators when programming, I fixed that already. It wasn't there in the final script because I paid more attention with that one because I was in my usual vim Bash-scripting environment and not in a GUI text editor writing Markdown like I was for the earlier section.
P.S. II: Regarding the potential issue with spaces in the path, I didn't think that was likely in the specific example, but I'll address that ASAP. I'll also credit you for your spot-on observations.
P.S. III: Regarding the issue with filenames starting with -, it actually would only be an issue if the first directory's name (the area) starts with -, and that is easily fixed by changing the command from convert ${picture} (...) to convert ./${picture} (...)