One more comment on bash with spaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



To follow up on the previous thread here about how awkward it is to use bash with spaces, I just read about someone on the ubuntu-users list who was having a problem with his backup strategy not working. He has a cron job to automatically make an archive which is stored on his external drive. The path to his external drive has spaces. Because of how cron works, the quotes were somehow being stripped, causing the archives to be corrupted, even though they worked fine from the command line. The moral of the story is that even when you are quoting everything, it doesn't always work. Once he removed the space, his cron job worked fine. Yes, I realize cron uses /bin/sh which is not always linked to bash. This is also a good reminder to test your scripts before using them in production. I usually put "echo" at the beginning of the command I want the script to execute (such as in a loop) to make sure it does what I expect.


--------------------
Tony Baechler, Baechler Access Technology Services
Putting accessibility at the forefront of technology
mailto:bats@xxxxxxxxxxxxxx
Phone: 1-619-746-8310   Fax: 1-619-449-9898

_______________________________________________
Blinux-list mailing list
Blinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/blinux-list



[Index of Archives]     [Linux Speakup]     [Fedora]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]