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

Re: bash: esc space not recognised in cat script ?



Colin Watson wrote:

On Sun, Jul 13, 2003 at 04:47:39PM +0100, David selby wrote:
Hello again, more thorny bash escaped space problems ...
in $_tox is a file called "this is a test" ....
Below is the portion of code that is causing problems ....

for _scantox in $_tox/* ; do
_scantox=${_scantox// /\\ }

Perhaps that should be:

 _scantox="${_scantox// /\\ }"

?

(And, actually, I don't get why you're doing all this grotty
substitution stuff anyway. Just write $_scantox as "$_scantox" *every
time you use it*. bash handles spaces just fine as long as you quote
everything.)

Your dead right ! I stripped off my substitution stuff, quoted "$_scantox" & it worked perfect. I was trying to get the escape backslashes just right, didn't realise bash was smart enough to sort it out for me.

Would I be flamed if I said I'm starting to like bash ?
Dave



Reply to: