On Wednesday, June 13, 2012, bobPCL <b...@purplecrowlidar.ca> wrote:
>"-bash: edit: command not found".
"edit" is not a bash command. You can invoke BBEdit using "bbedit"; but the EDITOR variable is used by other programs to invoke your preferred editor, and has no bearing on what you can (or can't) do at the command line.
Thanks for the response, sorry I wasn't clear. What I'm trying to do is use a command line window (e.g. terminal) and type the word "edit" and get bbedit to open. I have another script I want to run that using the default environment editor, which is currently not bbedit.
So do you (or anyone) know how to make bbedit the "preferred" editor?
On Wednesday, June 13, 2012 7:05:51 PM UTC-4, Rich Siegel wrote:
> >"-bash: edit: command not found".
> "edit" is not a bash command. You can invoke BBEdit using > "bbedit"; but the EDITOR variable is used by other programs to > invoke your preferred editor, and has no bearing on what you can > (or can't) do at the command line.
> Thanks for the response, sorry I wasn't clear. What I'm trying to do is use a command line window (e.g. terminal) and type the word "edit" and get bbedit to open. I have another script I want to run that using the default environment editor, which is currently not bbedit.
> So do you (or anyone) know how to make bbedit the "preferred" editor?
> On Wednesday, June 13, 2012 7:05:51 PM UTC-4, Rich Siegel wrote:
> >"-bash: edit: command not found".
> "edit" is not a bash command. You can invoke BBEdit using > "bbedit"; but the EDITOR variable is used by other programs to > invoke your preferred editor, and has no bearing on what you can > (or can't) do at the command line.
> Someday I'll look back on all this and laugh... until they > sedate me.
> -- > You received this message because you are subscribed to the > "BBEdit Talk" discussion group on Google Groups.
> To post to this group, send email to bbedit@googlegroups.com
> To unsubscribe from this group, send email to
> bbedit+unsubscribe@googlegroups.com
> For more options, visit this group at
> <http://groups.google.com/group/bbedit?hl=en>
> If you have a feature request or would like to report a problem, > please email "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
> macpro: ~ > source .bash_profile > macpro: ~ > echo $EDITOR > /usr/bin/bbedit > macpro: ~ > crontab -e (opens > crontab in bbedit) > crontab: no changes made to crontab > macpro: ~ >
> François
> On Jun 13, 2012, at 8:04 PM, bobPCL wrote:
> > Thanks for the response, sorry I wasn't clear. What I'm trying to do is > use a command line window (e.g. terminal) and type the word "edit" and get > bbedit to open. I have another script I want to run that using the default > environment editor, which is currently not bbedit.
> > So do you (or anyone) know how to make bbedit the "preferred" editor?
> > On Wednesday, June 13, 2012 7:05:51 PM UTC-4, Rich Siegel wrote:
> > >"-bash: edit: command not found".
> > "edit" is not a bash command. You can invoke BBEdit using > > "bbedit"; but the EDITOR variable is used by other programs to > > invoke your preferred editor, and has no bearing on what you can > > (or can't) do at the command line.
> > Someday I'll look back on all this and laugh... until they > > sedate me.
> > -- > > You received this message because you are subscribed to the > > "BBEdit Talk" discussion group on Google Groups. > > To post to this group, send email to bbedit@googlegroups.com > > To unsubscribe from this group, send email to > > bbedit+unsubscribe@googlegroups.com > > For more options, visit this group at > > <http://groups.google.com/group/bbedit?hl=en> > > If you have a feature request or would like to report a problem, > > please email "supp...@barebones.com" rather than posting to the group. > > Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
> thanks. That does work for crontab. Unfortunately it does work if you say "edit file.name", you can say bbedit but not edit.
> I guess it only works in some contexts. On my old unix systems I used to have emacs come up instead of vi, I just can't remember how I used to do it.
> On Wednesday, June 13, 2012 8:08:38 PM UTC-4, François Schiettecatte wrote:
> Bob
> macpro: ~ > source .bash_profile > macpro: ~ > echo $EDITOR > /usr/bin/bbedit > macpro: ~ > crontab -e (opens crontab in bbedit) > crontab: no changes made to crontab > macpro: ~ >
> François
> On Jun 13, 2012, at 8:04 PM, bobPCL wrote:
> > Thanks for the response, sorry I wasn't clear. What I'm trying to do is use a command line window (e.g. terminal) and type the word "edit" and get bbedit to open. I have another script I want to run that using the default environment editor, which is currently not bbedit.
> > So do you (or anyone) know how to make bbedit the "preferred" editor?
> > On Wednesday, June 13, 2012 7:05:51 PM UTC-4, Rich Siegel wrote:
> > >"-bash: edit: command not found".
> > "edit" is not a bash command. You can invoke BBEdit using > > "bbedit"; but the EDITOR variable is used by other programs to > > invoke your preferred editor, and has no bearing on what you can > > (or can't) do at the command line.
> > Someday I'll look back on all this and laugh... until they > > sedate me.
> > -- > > You received this message because you are subscribed to the > > "BBEdit Talk" discussion group on Google Groups. > > To post to this group, send email to bbedit@googlegroups.com > > To unsubscribe from this group, send email to > > bbedit+unsubscribe@googlegroups.com > > For more options, visit this group at > > <http://groups.google.com/group/bbedit?hl=en> > > If you have a feature request or would like to report a problem, > > please email "supp...@barebones.com" rather than posting to the group. > > Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
> -- > You received this message because you are subscribed to the > "BBEdit Talk" discussion group on Google Groups.
> To post to this group, send email to bbedit@googlegroups.com
> To unsubscribe from this group, send email to
> bbedit+unsubscribe@googlegroups.com
> For more options, visit this group at
> <http://groups.google.com/group/bbedit?hl=en>
> If you have a feature request or would like to report a problem, > please email "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
> thanks. That does work for crontab. Unfortunately it does work if you say "edit file.name", you can say bbedit but not edit.
> I guess it only works in some contexts. On my old unix systems I used to have emacs come up instead of vi, I just can't remember how I used to do it.
> On Wednesday, June 13, 2012 8:08:38 PM UTC-4, François Schiettecatte wrote:
> Bob
> macpro: ~ > source .bash_profile > macpro: ~ > echo $EDITOR > /usr/bin/bbedit > macpro: ~ > crontab -e (opens crontab in bbedit) > crontab: no changes made to crontab > macpro: ~ >
> François
> On Jun 13, 2012, at 8:04 PM, bobPCL wrote:
> > Thanks for the response, sorry I wasn't clear. What I'm trying to do is use a command line window (e.g. terminal) and type the word "edit" and get bbedit to open. I have another script I want to run that using the default environment editor, which is currently not bbedit.
> > So do you (or anyone) know how to make bbedit the "preferred" editor?
> > On Wednesday, June 13, 2012 7:05:51 PM UTC-4, Rich Siegel wrote:
> > >"-bash: edit: command not found".
> > "edit" is not a bash command. You can invoke BBEdit using > > "bbedit"; but the EDITOR variable is used by other programs to > > invoke your preferred editor, and has no bearing on what you can > > (or can't) do at the command line.
> > Someday I'll look back on all this and laugh... until they > > sedate me.
> > -- > > You received this message because you are subscribed to the > > "BBEdit Talk" discussion group on Google Groups. > > To post to this group, send email to bbedit@googlegroups.com > > To unsubscribe from this group, send email to > > bbedit+unsubscribe@googlegroups.com > > For more options, visit this group at > > <http://groups.google.com/group/bbedit?hl=en> > > If you have a feature request or would like to report a problem, > > please email "supp...@barebones.com" rather than posting to the group. > > Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
> -- > You received this message because you are subscribed to the > "BBEdit Talk" discussion group on Google Groups.
> To post to this group, send email to bbedit@googlegroups.com
> To unsubscribe from this group, send email to
> bbedit+unsubscribe@googlegroups.com
> For more options, visit this group at
> <http://groups.google.com/group/bbedit?hl=en>
> If you have a feature request or would like to report a problem, > please email "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
> I can open a terminal window in Mac Lion and run the command:
>>bbedit file.name
> and bbedit works, and says it is in /usr/bin/bbedit.
> If I try to put in my .profile: export EDITOR='/usr/bin/bbedit' I get
> "-bash: edit: command not found". Or the same thing happens if I put the
> command in .bashrc. Or if I leave off the /usr/bin and put it in either
> place. Always the same error.
> That being said if I put /usr/bin/edit that works (but not for bbedit).
> Would someone please let me know what I'm doing wrong? I'm running from
> an account with admin access.
Try:
`export EDITOR=/usr/bin/bbedit` (without the backticks)
in your bash_profile (assuming when you installed the command line tools
you chose `/usr/bin/`).
Similarly, you can use:
`export GIT_EDITOR=/usr/bin/bbedit`
for your git commit messages if you don't want to pass the `m` flag on
your commits.
That will work if you run your shell as a login shell (see
<https://rvm.io/support/faq/#shell_login> from the wonderful Wayne E.
Seguin for a brief explanation).
Also, unfortunately, there is no `sudo update-alternatives --config
editor` on OS X as there is GNU/Linux to make this scenario plainer.
Blame FreeBSD :-)
Cheers,
Phil...
- -- But masters, remember that I am an ass.
Though it be not written down,
yet forget not that I am an ass.
Wm. Shakespeare - Much Ado About Nothing
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: §auto-key-locate cert pka ldap hkp://keys.gnupg.net
Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
Just a note about using BBEdit for editing commit messages: I use '/usr/local/bin/bbedit --wait --resume' for that purpose, mainly to allow the commit message to be written before returning control to the invoking process. The "--wait" means "wait for document to be closed in BBEdit" and "--resume" means "restore focus to the invoking application when the document is closed in BBEdit".
>> I can open a terminal window in Mac Lion and run the command:
>>> bbedit file.name
>> and bbedit works, and says it is in /usr/bin/bbedit.
>> If I try to put in my .profile: export EDITOR='/usr/bin/bbedit' I get
>> "-bash: edit: command not found". Or the same thing happens if I put the
>> command in .bashrc. Or if I leave off the /usr/bin and put it in either
>> place. Always the same error.
>> That being said if I put /usr/bin/edit that works (but not for bbedit).
>> Would someone please let me know what I'm doing wrong? I'm running from
>> an account with admin access.
> Try:
> `export EDITOR=/usr/bin/bbedit` (without the backticks)
> in your bash_profile (assuming when you installed the command line tools
> you chose `/usr/bin/`).
> Similarly, you can use:
> `export GIT_EDITOR=/usr/bin/bbedit`
> for your git commit messages if you don't want to pass the `m` flag on
> your commits.
> That will work if you run your shell as a login shell (see
> <https://rvm.io/support/faq/#shell_login> from the wonderful Wayne E.
> Seguin for a brief explanation).
> Also, unfortunately, there is no `sudo update-alternatives --config
> editor` on OS X as there is GNU/Linux to make this scenario plainer.
> Blame FreeBSD :-)
> Cheers,
> Phil...
> - -- > But masters, remember that I am an ass.
> Though it be not written down,
> yet forget not that I am an ass.
> Wm. Shakespeare - Much Ado About Nothing
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: §auto-key-locate cert pka ldap hkp://keys.gnupg.net
> Comment: GPGTools - http://gpgtools.org > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
On Thursday, June 14, 2012 12:39:24 AM UTC-4, Grail wrote:
> Just a note about using BBEdit for editing commit messages: I use > '/usr/local/bin/bbedit --wait --resume' for that purpose, mainly to allow > the commit message to be written before returning control to the invoking > process.
Grail raises an excellent point: by default the bbedit command will turn immediately. This causes some confusion with some command line tools, which expect the editor command to quit only after the user has saved and quit their writing.
In English, most command line tools expect to fire off the editor, and expect to hear back from the user when they are done editing. Instead, what the bbedit command does (by default) is to open the file in BBEdit then return immediately.
So, the bbedit tool is written to behave like: "Ok, I have displayed the file to the user, my job is done". Where as most command line tools expect the editor's job to be done when the user saves + closes the document in question.
if [[ $SSH_CONNECTION ]] then vim "$@" else bbedit -w "$@" fi
This script says, "If the user is SSHing in right now, use vim as the editor. Else use BBEdit and wait around until the user closes the document in question".
Why the check about SSH connections? I sometimes SSH into my main OS X machine using a Linux netbook. If I need to edit a file I don't want to launch BBEdit because I have no way of editing the text then because I'm not in front of OS X right now.
It is not relevant, all the alias does is replace the command 'edit' with the command '/usr/bin/bbedit', the default MacOS X install does not have an 'edit' command.
Note that you can add parameters to the alias:
alias edit='/usr/bin/bbedit --wait --resume'
There is the '/usr/bin/open' command which will open a document with its Mac application, so I would use that for you images, etc...
> -- > You received this message because you are subscribed to the > "BBEdit Talk" discussion group on Google Groups.
> To post to this group, send email to bbedit@googlegroups.com
> To unsubscribe from this group, send email to
> bbedit+unsubscribe@googlegroups.com
> For more options, visit this group at
> <http://groups.google.com/group/bbedit?hl=en>
> If you have a feature request or would like to report a problem, > please email "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
>It is not relevant, all the alias does is replace the command 'edit' with the command '/usr/bin/bbedit', the default MacOS X install does not have an 'edit' command.
>Note that you can add parameters to the alias:
> alias edit='/usr/bin/bbedit --wait --resume'
>There is the '/usr/bin/open' command which will open a document with its Mac application, so I would use that for you images, etc...
>François
>On Jun 14, 2012, at 1:58 PM, Rick Gordon wrote:
>> But how will that work for other classes of documents, such as images, which have their own default editor?
>> ------------------
>> On 6/14/12 at 8:28 AM -0500, Rod Buchanan wrote in a message entitled
>> "Re: change default editor to bbedit":
>>> On Jun 13, 2012, at 7:25 PM, bobPCL wrote:
>>>> thanks. That does work for crontab. Unfortunately it does work if you say "edit file.name", you can say bbedit but not edit.
>> --
>> You received this message because you are subscribed to the
>> "BBEdit Talk" discussion group on Google Groups.
>> To post to this group, send email to bbedit@googlegroups.com
>> To unsubscribe from this group, send email to
>> bbedit+unsubscribe@googlegroups.com
>> For more options, visit this group at
>> <http://groups.google.com/group/bbedit?hl=en>
>> If you have a feature request or would like to report a problem,
>> please email "supp...@barebones.com" rather than posting to the group.
>> Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
>--
>You received this message because you are subscribed to the
>"BBEdit Talk" discussion group on Google Groups.
>To post to this group, send email to bbedit@googlegroups.com
>To unsubscribe from this group, send email to
>bbedit+unsubscribe@googlegroups.com
>For more options, visit this group at
><http://groups.google.com/group/bbedit?hl=en>
>If you have a feature request or would like to report a problem,
>please email "supp...@barebones.com" rather than posting to the group.
>Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>