On the Mac, dia
(specifically /Applications/Dia.app/Content/Resources/bin/dia
) is just a shell script wrapper to the compiled dia-bin
binary. It sets a number of environmental variables, and then finishes by executing Dia as a GUI:
exec "$CWD/dia-bin" --integrated
You can make a copy (e.g. cp -p dia dia-cmd
) and edit that last line in dia-cmd
to become:
"$CWD/dia-bin" $@
and then you can use it as dia-cmd
within the terminal.
Note: I found that for my locale (en_US.UTF-8), at least, running dia-cmd
in the terminal was way too chatty about trying to determine the correct locale, spewing ignorable warnings:
Warning: AppleCollationOrder setting not found, using AppleLocale.
Setting Language: en.UTF8
(process:33043): Gdk-WARNING **: locale not supported by C library
(process:33043): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
You can eliminate that by also commenting-out those lines in dia-cmd
, and manually forcing the correct locale:
## LANGSTR=`defaults read .GlobalPreferences AppleCollationOrder 2>/dev/null`
## if [ "x$LANGSTR" == "x" ]
## then
## echo "Warning: AppleCollationOrder setting not found, using AppleLocale." 1>&2
## LANGSTR=`defaults read .GlobalPreferences AppleLocale 2>/dev/null | \
## sed 's/_.*//'`
## fi
# NOTE: Have to add ".UTF-8" to the LANG since omitting causes Dia
# to crash on startup in locale_from_utf8().
## export LANG="$LANGSTR.UTF8"
export LANG="en_US.UTF-8"
## echo "Setting Language: $LANG" 1>&2
Voila:
MYMACHINE:~ lars$ /Applications/Dia.app/Contents/Resources/bin/dia-cmd -v
Dia version 0.97.2, compiled 18:51:13 Mar 17 2012
Looks to me as though it's running
/Applications/Atom.app/Contents/Resources/app/atom.sh
but you should be able to edit your ~/.bash_config
and add the line
alias atom="/Applications/Atom.app/Contents/MacOS/Atom"
then re-open terminal and you'll be able to launch atom by typing atom [filename]
, assuming your copy of Atom is installed in the /Applications folder
Best Answer
The command you want is:
fdesetup
From its manual page: