It's true I don't deal with books from BARD in BASH. I do deal with them
in Python though. I pretty much do the same thing you're doing.
On 07/31/2015 04:09 AM, Tony Baechler wrote:
I apologize in advance to people outside of the US.
Obviously, Christopher, you've never had to deal with books from NLS
BARD in bash before. It's a major problem because of the spaces. I did
eventually find a workaround courtesy of cyberciti.biz. If anyone
cares, I'll post my script, but it's very specific to my local setup.
No, I don't wish to rename them because I want to keep the book number
and as much other information as possible. Out of curiosity, how would
you handle names like this? I want to make a new directory on my SD
card under $vrdtb, cd to that directory, unzip the NLS book and repeat.
I generally have at least a few dozen books to process at a time.
Again, I now have a working solution. Until I did some experimenting and
poking around on Google, I had to do this manually. When NLS started
adding a lot more books every week from their analog conversion, this
was no longer practical. The filenames appear below:
DB -- Analog Science Fiction and Fact (Astounding!) (December 2012).zip
DB Asimov's Science Fiction June_ 2013.zip
DB New York Times Book Review October 27_ 2013.zip
DB-Unspecified-The Holy Bible, Containing the Old and New Testaments-
Translated out of the Original Tongues and with the Former Translations
Diligently Compared a-DB68777.zip
To directly answer your question, bash tries to process each word of the
filename separately, even when you put them in quotes, at least in a for
loop. If you manually process one at a time, it works fine. I don't
know why it doesn't work in a for loop even with quoting the filename,
but it doesn't. You have to tell bash to not treat space as a separator.
On 7/30/2015 5:36 AM, Christopher Chaltain wrote:
I guess I'd need to see an example of how these characters trip
someone up
in a file name using a BASH script while they are handled differently
in the
DOS batch processor. With few exceptions, I find quoting literals to work
both in a script file and on the command line.
_______________________________________________
Blinux-list mailing list
Blinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/blinux-list
--
Christopher (CJ)
chaltain at Gmail
_______________________________________________
Blinux-list mailing list
Blinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/blinux-list