Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Install BBEdit command line tools for added power Apps
If you have BBEdit 6.5.x, be sure to install the Unix Tools that are in the extras folder. You can then do the following:
  • bbedit somefile.txt to open a file in BBEdit
  • bbedit -c somefile.txt to open a new file with that name in BBEdit
  • bbedit -w to open BBEdit and have it wait until you are done to send the contents back to the shell. You can then "EDITOR=bbedit -w" in your shell source.
  • grep 'foo' bigfile.txt | bbedit to send the results of Unix commands to BBEdit
  • many more - see man bbedit for details
Hope you find this useful as I have!
  • Currently 2.60 / 5
  You rated: 2 / 5 (5 votes cast)

Install BBEdit command line tools for added power | 5 comments | Create New Account
Click here to return to the 'Install BBEdit command line tools for added power' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
problem with UFS volumes
Authored by: Franco on Apr 09, '02 04:28:30AM

Note that the bbedit Unix tool currently shipped with 6.5.2 does not work on files stored on UFS volumes. The BBEdit developers are aware of the issue, and are working on a fix that will be probably included in a forthcoming update.

[ Reply to This | # ]
EDITOR=bbedit -w
Authored by: thinkyhead on Apr 09, '02 10:11:01PM

I fount that EDITOR='bbedit -w' fails for some purposes, either CVS or crontab -e as I recall. The solution is to make a little script like this:

bbedit -w $1

... and then use the script as your EDITOR.

[ Reply to This | # ]
'bbedit -c' isn't the default
Authored by: ddp on Apr 10, '02 04:44:24PM

Note also that the command line tool doesn't create non-existent files by default like most every other editor on the planet. I stuffed an 'alias bbedit bbedit -c' in my .cshrc and I'm much happier.

[ Reply to This | # ]
BBEdit remote files
Authored by: datasmid on Feb 06, '03 04:13:23AM

I like BBEdit to browse any textfile on my network
so on linux boxes I have this alias defined (for tcsh)

alias bbedit "ssh user@mac bbedit <"

On my Mac I have Remote Login enabled in Sharing Prefpanel
and on Mac my, ssh-keygen generated on linux, public key in ~/.ssh/authorized_keys2

Whenever I want to open a file on Linux I do

$ bbedit file

And it loads through the ssh-tunnel in BBEdit

[ Reply to This | # ]
BBEdit remote files
Authored by: i5ao on Oct 21, '04 06:12:34PM

Awesome tip!

But it opens the file in an untitled window in BBEdit on the Mac side. With BBEdit 8's command line tool you can do one better. It accepts sftp urls, so I modified your shell script as follows:

# Usage file
ssh me@machostname bbedit sftp://me@`hostname`/`pwd`/$1

Save this file as executable on your remote Linux/BSD box as, say, somewhere in your $PATH.

Then, while logged in on that box, to edit a file there called "foo.c" do this:

% foo.c

On your Mac, BBEdit will open up the file on the remote machine. Edit and save in-place.

[ Reply to This | # ]