FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 11-11-2011, 03:59 PM
Peng Yu
 
Default Why crontab -e doesn't use the correct editor?

Hi,

~$ echo $EDITOR

~$ echo $VISUAL

~$ ll /usr/bin/editor
lrwxrwxrwx 1 root root 24 2010-05-14 17:23 /usr/bin/editor ->
/etc/alternatives/editor
pengy@pengy-desktop:~$ readlink -f -e /usr/bin/editor
/usr/bin/vim.gnome

I have the above environment. But when I call run "crontab -e". nano
is invoked. I think that vim.genome should be called. I'm wondering
why the correct one is not called?

--
Regards,
Peng

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-11-2011, 04:26 PM
"roberto.preziusi@gmail.com"
 
Default Why crontab -e doesn't use the correct editor?

2011/11/11 Peng Yu <pengyu.ut@gmail.com>
*

I have the above environment. But when I call run "crontab -e". nano

is invoked. I think that vim.genome should be called. I'm wondering*why the correct one is not called?



try:



sudo update-alternatives --config editor



bye

--
Preziusi Roberto

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-11-2011, 04:29 PM
Colin Law
 
Default Why crontab -e doesn't use the correct editor?

On 11 November 2011 16:59, Peng Yu <pengyu.ut@gmail.com> wrote:
> Hi,
>
> ~$ echo $EDITOR
>
> ~$ echo $VISUAL
>
> ~$ ll /usr/bin/editor
> lrwxrwxrwx 1 root root 24 2010-05-14 17:23 /usr/bin/editor ->
> /etc/alternatives/editor
> pengy@pengy-desktop:~$ readlink -f -e /usr/bin/editor
> /usr/bin/vim.gnome
>
> I have the above environment. But when I call run "crontab -e". nano
> is invoked. I think that vim.genome should be called. I'm wondering
> why the correct one is not called?

Just to check, if you run /usr/bin/editor does it run vim?

Colin

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-11-2011, 09:02 PM
Peng Yu
 
Default Why crontab -e doesn't use the correct editor?

On Fri, Nov 11, 2011 at 11:29 AM, Colin Law <clanlaw@googlemail.com> wrote:
> On 11 November 2011 16:59, Peng Yu <pengyu.ut@gmail.com> wrote:
>> Hi,
>>
>> ~$ echo $EDITOR
>>
>> ~$ echo $VISUAL
>>
>> ~$ ll /usr/bin/editor
>> lrwxrwxrwx 1 root root 24 2010-05-14 17:23 /usr/bin/editor ->
>> /etc/alternatives/editor
>> pengy@pengy-desktop:~$ readlink -f -e /usr/bin/editor
>> /usr/bin/vim.gnome
>>
>> I have the above environment. But when I call run "crontab -e". nano
>> is invoked. I think that vim.genome should be called. I'm wondering
>> why the correct one is not called?
>
> Just to check, if you run /usr/bin/editor does it run vim?

I tried it, yes. See also

~$ readlink -f -e /usr/bin/editor
/usr/bin/vim.gnome



--
Regards,
Peng

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

Sat Nov 12 00:30:03 2011
Return-path: <gentoo-dev+bounces-48552-tom=linux-archive.org@lists.gentoo.org>
Envelope-to: tom@linux-archive.org
Delivery-date: Sat, 12 Nov 2011 00:04:26 +0200
Received: from pigeon.gentoo.org ([208.92.234.80]:51864 helo=lists.gentoo.org)
by s2.java-tips.org with esmtps (TLSv1:AES256-SHA:256)
(Exim 4.69)
(envelope-from <gentoo-dev+bounces-48552-tom=linux-archive.org@lists.gentoo.org>)
id 1ROzD0-0001G0-N9
for tom@linux-archive.org; Sat, 12 Nov 2011 00:04:26 +0200
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
by pigeon.gentoo.org (Postfix) with SMTP id DF2F621C0CC;
Fri, 11 Nov 2011 22:04:16 +0000 (UTC)
X-Original-To: gentoo-dev@lists.gentoo.org
Delivered-To: gentoo-dev@lists.gentoo.org
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
by pigeon.gentoo.org (Postfix) with ESMTP id 39D0F21C098
for <gentoo-dev@lists.gentoo.org>; Fri, 11 Nov 2011 22:01:59 +0000 (UTC)
Received: from [192.168.178.20] (e178072056.adsl.alicedsl.de [85.178.72.56])
(using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
(No client certificate requested)
(Authenticated sender: chithanh)
by smtp.gentoo.org (Postfix) with ESMTPSA id 2F9151B4047
for <gentoo-dev@lists.gentoo.org>; Fri, 11 Nov 2011 22:01:57 +0000 (UTC)
Message-ID: <4EBD9B47.6030008@gentoo.org>
Date: Fri, 11 Nov 2011 23:01:43 +0100
From: =?UTF-8?B?Q2jDrS1UaGFuaCBDaHJpc3RvcGhlciBOZ3V54buFbg==?=
<chithanh@gentoo.org>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20111031 Firefox/7.0.1 SeaMonkey/2.4.1
Precedence: bulk
List-Post: <mailto:gentoo-dev@lists.gentoo.org>
List-Help: <mailto:gentoo-dev+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-dev+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-dev+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-dev.gentoo.org>
X-BeenThere: gentoo-dev@lists.gentoo.org
Reply-to: gentoo-dev@lists.gentoo.org
MIME-Version: 1.0
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] rfc: openrc: use iproute2 for all network handling
in linux
References: <20111111215344.GA31226@linux1>
In-Reply-To: <20111111215344.GA31226@linux1>
X-Enigmail-Version: 1.4a1pre
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

William Hubbs schrieb:
> I realize there would be a trade-off if I stop supporting linux's
> ifconfig and route in openrc, but how much of a trade-off? Would the
> benefits of iproute2 outweigh the down side of not supporting ifconfig
> and route on linux?
>=20
> What does everyone think?

+1
Do you need iproute2 at all? I think you could fall back to busybox if
iproute2 is not installed.

While you are at it, please also switch from wireless-tools to iw
https://bugs.gentoo.org/show_bug.cgi?id=3D261655


Best regards,
Ch=C3=AD-Thanh Christopher Nguy=E1=BB=85n
 
Old 11-11-2011, 09:04 PM
Peng Yu
 
Default Why crontab -e doesn't use the correct editor?

On Fri, Nov 11, 2011 at 11:26 AM, roberto.preziusi@gmail.com
<roberto.preziusi@gmail.com> wrote:
>
>
> 2011/11/11 Peng Yu <pengyu.ut@gmail.com>
>
>>
>> I have the above environment. But when I call run "crontab -e". nano
>> is invoked. I think that vim.genome should be called. I'm wondering
>>
>> why the correct one is not called?
>
> try:
>
> sudo update-alternatives --config editor
>
> bye

vim has already been selected. I'm not sure why crontab -e doesn't use
it. I have to set the environment variable EDITOR to use vim. Does
crontab -e use some logic different from what is described in the man
page to select the editor?

~$ sudo update-alternatives --config editor
[sudo] password for pengy:
There are 6 choices for the alternative editor (providing /usr/bin/editor).

Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/vim.gnome 60 auto mode
1 /bin/ed -100 manual mode
2 /bin/nano 40 manual mode
3 /usr/bin/mcedit 25 manual mode
4 /usr/bin/vim.gnome 60 manual mode
5 /usr/bin/vim.gtk 50 manual mode
6 /usr/bin/vim.tiny 10 manual mode

Press enter to keep the current choice[*], or type selection number:


--
Regards,
Peng

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-14-2011, 07:23 AM
"roberto.preziusi@gmail.com"
 
Default Why crontab -e doesn't use the correct editor?

2011/11/11 Peng Yu <pengyu.ut@gmail.com>



$ sudo update-alternatives --config editor

[sudo] password for pengy:

There are 6 choices for the alternative editor (providing /usr/bin/editor).



*Selection * *Path * * * * * * * *Priority * Status

------------------------------------------------------------

* 0 * * * * * */usr/bin/vim.gnome * 60 * * * *auto mode

*1 * * * * * */bin/ed * * * * * * -100 * * * manual mode

*2 * * * * * */bin/nano * * * * * *40 * * * *manual mode

*3 * * * * * */usr/bin/mcedit * * *25 * * * *manual mode

*4 * * * * * */usr/bin/vim.gnome * 60 * * * *manual mode

*5 * * * * * */usr/bin/vim.gtk * * 50 * * * *manual mode

*6 * * * * * */usr/bin/vim.tiny * *10 * * * *manual mode



Press enter to keep the current choice[*], or type selection number:




Con you conferm me wich file is linked to EDITOR in /etc/alternatives ?

ls -l /etc/alternatives/ | grep "editor ->"



I choose vim.tiny for everything:

$ ls -l /etc/alternatives/ | grep "editor ->"
lrwxrwxrwx 1 root root* 17 2011-05-29 17:18 editor -> /usr/bin/vim.tiny

I love VIM



bye
--
Preziusi Roberto

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-14-2011, 01:27 PM
Marius Gedminas
 
Default Why crontab -e doesn't use the correct editor?

On Fri, Nov 11, 2011 at 10:59:24AM -0600, Peng Yu wrote:
> Hi,
>
> ~$ echo $EDITOR
>
> ~$ echo $VISUAL
>
> ~$ ll /usr/bin/editor
> lrwxrwxrwx 1 root root 24 2010-05-14 17:23 /usr/bin/editor ->
> /etc/alternatives/editor
> pengy@pengy-desktop:~$ readlink -f -e /usr/bin/editor
> /usr/bin/vim.gnome
>
> I have the above environment. But when I call run "crontab -e". nano
> is invoked. I think that vim.genome should be called. I'm wondering
> why the correct one is not called?

$ strings $(which crontab)|grep editor
/usr/bin/sensible-editor

/usr/bin/sensible-editor is a shell script that tries $VISUAL, EDITOR,
a $SELECTED_EDITOR (which I'd never seen before), and it spawns some
text-mode interactive menu (/usr/bin/select-editor), or looks for a
saved setting in ~/.selected_editor. It falls back to nano if none of
the other options work.

What's the content of ~/.select_editor, if the file exists?

Crontab's manual page appears to be incorrect where it says crontab will
use /usr/bin/editor. I'd be inclined to file a bug about that.

Marius Gedminas
--
A witty saying proves nothing.
-- Voltaire
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-14-2011, 01:44 PM
Peng Yu
 
Default Why crontab -e doesn't use the correct editor?

> What's the content of ~/.select_editor, if the file exists?

Here is what I have.

~$ strings $(which crontab)|grep editor
/usr/bin/sensible-editor
%s: editor or filename too long
~$ cat /usr/bin/sensible-editor
#!/bin/sh

ret="$?"

# Prevent recursive loops, where these values are set to this script
p="$(which sensible-editor)"
[ "$(which $EDITOR || true)" = "$p" ] && EDITOR=
[ "$(which $VISUAL || true)" = "$p" ] && VISUAL=
[ "$(which $SELECTED_EDITOR || true)" = "$p" ] && SELECTED_EDITOR=

if [ -n "$VISUAL" ]; then
${VISUAL} "$@"
ret="$?"
if [ "$ret" -ne 126 ] && [ "$ret" -ne 127 ]; then
exit "$ret"
fi
fi

if [ -r ~/.selected_editor ]; then
. ~/.selected_editor 2>/dev/null || true
elif [ -z "$EDITOR" ] && [ -z "$SELECTED_EDITOR" ] && [ -t 0 ]; then
select-editor && . ~/.selected_editor 2>/dev/null || true
fi

${EDITOR:-${SELECTED_EDITOR:-editor}} "$@"
ret="$?"
if [ "$ret" -eq 126 ] || [ "$ret" -eq 127 ]; then
nano "$@"
ret="$?"
if [ "$ret" -eq 126 ] || [ "$ret" -eq 127 ]; then
nano-tiny "$@"
ret="$?"
if [ "$ret" -eq 126 ] || [ "$ret" -eq 127 ]; then
vi "$@"
ret="$?"
if [ "$ret" -eq 126 ] || [ "$ret" -eq 127 ]; then
echo "Couldn't find an editor!" 1>&2
echo "Set the $EDITOR environment variable to your desired editor." 1>&2
exit 1
fi
fi
fi
fi
exit "$ret"

--
Regards,
Peng

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 02:37 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org