As @laaph mentioned, if you just want to run bash commands, use a bash script.
There are, however, a few issues with your commands.
Your script has to look like:
#!/bin/sh
pushd ~/Library/Vidalia
rm vidalia.conf
unzip vidalia.conf.zip
popd
open /Applications/Vidalia.app
If you didn't change to the correct directory, unzip
would unzip the file into your home directory, or wherever you launched your script from.
There are ways to look for when an app quits, but in your case this seems useless, you're removing the .conf
whenever you launch the script anyway. But if you really want that, you could simply do:
#!/bin/sh
pushd ~/Library/Vidalia
rm vidalia.conf
unzip vidalia.conf.zip
popd
open -W /Applications/Vidalia.app
pushd ~/Library/Vidalia
rm vidalia.conf
popd
(This would make the script wait until you close the app, and then it'd delete the configuration file. Again though, this is useless and redundant if you'll be only launching the app with the script.)
Also, you could try a simpler solution: I assume that what you want is just to have the same vidalia.conf whenever you start the program. If that's the case, try just making the .conf
read-only.
The preferences appear to be at: ~/Library/Preferences/com.apple.Terminal.plist
See also this question on SO and another question on SU that focus on exporting the settings from one Mac and moving them to another.
For older macOS, you can edit the file directly but on newer OS (with newer being 10.9 and later) you will want to use the defaults command to write the values to the persistent database (which may or may not flush back changes to the filesystem) rather than editing the file.
defaults read com.apple.Terminal
Or to write the secure keyboard entry function (as one easy example):
defaults write com.apple.Terminal SecureKeyboardEntry 1
Best Answer
mdfind
does not produce an unsuccessful exit code but you could pipe the results togrep
which does. The code would look something like this:||
is logical or.It could also be written