10.3: Create text files with enhanced open command

Dec 24, '03 01:00:00PM

Contributed by: ngb

I ran across this accidentally when I typed 'open' in terminal and forgot to include any arguments.


$ open
Usage: open [-e] [-a <appname>] [filenames]
Help: Open opens files from a shell.
      By default, opens each file using the default application for that file.  
      If the file is in the form of a URL, the file will be opened as a URL.
Options: 
      -a  Opens with the specified application.
      -e  Opens with TextEdit.
      -f  Reads input from standard input and opens with TextEdit.
Typing open -f works much the same way as cat > somefilename, with the end of input being indicated by hitting Control-D, with the result being a new TextEdit document. Unfortunately, there doesn't seem to be a way to specify the name of the document.

I didn't remember seeing this before, and verified that it did not exist in 10.2.

Comments (3)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20031029024149786