New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

Start a Discussion

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

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

Post Reply New Thread Subscribe

Thread Tools

Member Since: Dec 18, 2009
Posts: 1
Onikaji is on a distinguished road

Onikaji is offline
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?
QUOTE Thanks

Post Reply New Thread Subscribe

« burning with dvdrecord from dvdrtools port, how to access dvdburner from cli? | Maintaining the state of the application »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Starter
Last Post
Display environment variable and custom script russell23 OS X - Operating System 5 07-10-2009 11:33 PM
Shell Script Address Book Mbengi Bongi OS X - Development and Darwin 0 04-28-2009 03:02 PM Creating An Executable Shell Script ebay Running Windows (or anything else) on your Mac 7 04-28-2008 06:43 PM
shell script xml MrGecko OS X - Development and Darwin 4 10-03-2006 07:44 AM
tsch script - nested loop dynamic variable reference lizardthefish OS X - Development and Darwin 0 03-04-2004 11:53 PM

All times are GMT -4. The time now is 02:14 PM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.

Welcome to

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!

(4 digit year)

Already a member?