On 02/03/07, MJ Ray mjr@phonecoop.coop wrote:
samwise samwise@bagshot-row.org wrote:
I want to call an external binary with a parameter made of filenames which may contain spaces.
I don't think bash handles this well at all because it reparses strings sometimes but not others. Either you do it a different way (as your later comment suggests you're doing, using arrays) or you change shell - this exact problem is part of the reason I use /bin/rc when possible.
Sorry,
Well, finally got it sorted on Friday evening ... and didn't have to resort to arrays. Basically, I was sending through escaped spaces ... and the binary can't handle that. It works from the command line because bash strips those off. So, I needed to quote the parameters, but not escape them. However, even that didn't work with double quotation marks - I had to resort, in the end, to single quotation marks.
Finally got their ... but I've spent far too many man-hours on what should have been a simple task. :/
Ah, well - hopefully I learned something for it!
Peter.