12-18-2009, 02:43 PM #1
shell script improperly converts variable name to string as an argument.
- Member Since
- Dec 18, 2009
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?
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By Hyper in forum OS X - Development and DarwinReplies: 12Last Post: 05-22-2011, 11:36 AM
By Straitsfan in forum OS X - Apps and GamesReplies: 0Last Post: 01-30-2011, 09:04 PM
By jc6 in forum OS X - Development and DarwinReplies: 1Last Post: 10-23-2010, 06:36 PM
By russell23 in forum OS X - Operating SystemReplies: 5Last Post: 07-10-2009, 11:33 PM
By lizardthefish in forum OS X - Development and DarwinReplies: 0Last Post: 03-04-2004, 11:53 PM