User to user discussion and support for UltraEdit, UEStudio, UltraCompare, and other IDM applications.

A place for users to discuss the Mac-based version of UltraEdit.
13 posts Page 1 of 1
I would like to be able to launch UE from the terminal windows. How do I set an alias so that I can invoke UE from a command line?

Can you provide more information as to why you'd want to do this?
Remember TERMINAL is a character based interface, and UltraEdit is a GUI
Dave -

Thanks for your response. I am aware of the differences between terminal mode and GUI. I am in need to navigate via terminal to edit the configuration files for MySQL and PHP and other configuration type of files which are more easily navigated via terminal than through the finder. I would like to then invoke a command like, sudo UEM <filename> ; which would then invoke the UE editor with my text file ready for editing. I know this type of functionality is available with other editors and would like assistance in the proper way to implement for UEM.

Here is what I have done to enable launching of UEM from the terminal.

I edited .profile in my home directory and add the following line.

alias uem="open -a /Applications/"

This creates an alias of uem which launches the GUI editor.

You can put the file after uem to have that file loaded for example, uem .profile, will open the .profile file in UEM.

I hope this helps others out there for more info check out this link: ... -terminal/

One feature I miss from TextMate is the ability to open a list of files without loading any into the editor. For example, if I type "mate *" it basically creates a project on the fly containing everything in and below the current directory. This is much nicer than manually creating a project for the same files in UE.

I don't understand the objection to launching UE from a terminal window. It's basically the only way I ever launch editors. The better command-line support UE and UC have the better, IMO. I can't wait for a UC port so I can use it as the default diff tool for SVN and other source-code management systems.
I use deltawalker on the Mac. I use UC on my PCs.
I'll use this until I find a way to see hidden files in the UE file open dialog. The only other way I've found is to set the environment so that no files are hidden. That is less satisfying than the method described here. Does anyone know a way to force UltraEdit to show hidden files?
complexmath wrote: I don't understand the objection to launching UE from a terminal window. It's basically the only way I ever launch editors.

I just switched from PC to Mac. Primarily, I did so because I have become very familiar with Unix over the years, and OS X, being built on BSD, is also evolving to be more Unix-ish. (Oh, and Windows is evolving to be more LAME.)

Anyway, I think the objection stems from the classic Mac users, who fear using Terminal, and who resist the "PC-ification" of OS X, not realizing that it's actually a movement towards Unix/Linux. There is a growing trend of Linux types who are embracing Mac these days, and we're bringing our Shell along with a vengeance! I think the Mac landscape has room enough for both paradigms.
There are at least a few ways of going about this. First is an alias, which has already been covered:

Code: Select all
alias ue='open -a '

The other trick is to make a link from somewhere in your path to the UltraEdit program inside the .app folder. This is what I did:

Code: Select all
sudo ln -s /Applications/ /usr/local/bin/ultraedit

You'll want to specify a background process unless you want the terminal hanging. I've found it easier, typically, to use the alias.
This is more a question about running a shell command from our compilers to call UEM. Getting UEM to load works as already described, but we always have to use the expanded name. If we use the command line as described for the Linux version, we get a new instance of UEM for each call. Is there a way to force a single instance?

spelc wrote: ... Is there a way to force a single instance?


There is an option in preferences in the Windows version of UE. Evidently that option has not yet been ported.

You may want to send a note to UE support requesting that option to be ported sooner rather than later. :)

With the latest UE for Mac, when you run "open" from command line in a terminal, it passes the arguments to the first instance of UE it finds running, or launches a new one:

Code: Select all
open -a /Applications/ $* > /dev/null 2>&1 &

If you make a soft link to the executable under /usr/local/bin, the 'open' looks like this
Code: Select all
sudo ln -s  /Applications/ /usr/local/bin/ultraedit

# then

open -a  /usr/local/bin/ultraedit $* > /dev/null 2>&1 &

# or $PATH contains /usr/local/bin

open -a ultraedit $* > /dev/null 2>&1 &

I created a bash function and put it in my ~/.bashrc to open UltraEdit from the command line:

Code: Select all
   for FILE in "$@"; do
      if [ ! -e "$FILE" ]; then
        touch "$FILE"
   open -a "UltraEdit" "$@"

This will open a file or, if it doesn't exist, create a file and the open it i.e. ue filename

This also works for opening and creating multiple files i.e.

  • ue *.txt
  • ue filename1 filename2
  • ue filetocreate1 /fullpath/and/filename2
I can't take the credit for this. I took the idea from iA Writer.
13 posts Page 1 of 1