1

I have a command I'm running in OS X. It works perfectly:

$ osascript -e 'quit app "Base"' && cd /Users/davechambers/Library/Android/sdk/platform-tools/ && ./adb pull data/data/uk.co.davechambers.pegboard/databases/we-need-db ~/Desktop/ | open -a "Base"

I made it into an alias via:

$ alias pullRoom="osascript -e 'quit app "Base"' && cd /Users/davechambers/Library/Android/sdk/platform-tools/ && ./adb pull data/data/uk.co.davechambers.pegboard/databases/we-need-db ~/Desktop/ | open -a "Base""

When I run pullRoom however I get the error:

9:13: execution error: The variable Base is not defined. (-2753)

How should I have defined the alias so pullRoom will work?

  • 1
    Have a second look at where the quoting " for the alias begins and where it ends. – muru Aug 1 '18 at 6:15
  • @muru Thanks for the tip. I'll check later when I'm back at my machine. – Dave Chambers Aug 1 '18 at 6:54
2

Stuff like this can quickly get you into quoting hell :-) I usually go with a shell function in such situations.

function pullRoom() {
    osascript -e 'quit app "Base"' &&
       cd /Users/davechambers/Library/Android/sdk/platform-tools/ &&
       ./adb pull data/data/uk.co.davechambers.pegboard/databases/we-need-db ~/Desktop/ |
    open -a "Base"
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.