shell script improperly converts variable name to string as an argument.

Joined
Dec 18, 2009
Messages
1
Reaction score
0
Points
1
Hey All,


I'm having a slight issue with a shell script I'm working on, basically i need to duplicate then patch a small set of .app files, to do this I'm basically using a variable pointed at the correct version of the patcher and a variable pointed at the correct version of the app. The code line looks like:


sudo $toPatcher $toApp

the problem I'm running into is that there's a space in the address that $toApp points to, and I can't seem to get it to include the whole thing as one string, I've tried putting quotes around it, but the first quote appears to be ignored and the second seen as just another character, I've also tried using a \ instead of quotes to mark the space, but that also lead to the same issue.

The closest I've gotten is assigning " to a variable the writing the line as

sudo $toPatcher $slashVariable$toApp$slashVariable

that causes it to go to the correct directory but put a $ on the end of the .app name so the .app is still unrecognized. Any suggestions?
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top