Correct use of .bashrc file

Hi experts,
i'm trying to change the default editor used by the cronntab -e command.

The following commmands work in bash command line:

[root] VISUAL=/usr/bin/"mc -e"
[root] export VISUAL

Next i want that root use the mc editor by default, but when i try to add the same lines in the .bashrc file, i get no changes ("crontab -e"  starts "vi" instead of "mc").
In a script, must be the sintax slightly different ?

Regards
balromAsked:
Who is Participating?
 
NetminderConnect With a Mentor Commented:
Closed, 50 points refunded.
Netminder
Site Admin
0
 
periwinkleCommented:
try:

SETENV VISUAL /usr/bin/"mc -e"

or

SET VISUAL=/usr/bin/"mc -e"

Does Cron use the visual editor, though, or the plan EDITOR?

You might try setting that variable, too.
0
 
balromAuthor Commented:
Thanks pieriwinkle,
it seems that the .bashrc script is not be executed.
Are there some settings wrong?
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
periwinkleCommented:
which flavor of linux?  What is your shell?  

It's possible that the general login scripts in /etc are overriding you.

Try creating:

.login

instead.
0
 
balromAuthor Commented:
I'm using Linux slackware 10.2.

My shell is bash (i've seen this in the passwd file).

in other created users, i've seen that there is a .bashrc file.
0
 
balromAuthor Commented:
There is the script that i use:
------------------
# .bashrc

# User specific aliases and functions
alias ls="ls -la --color"
SETENV VISUAL="/usr/bin/mc -e"
export VISUAL

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
------------------
0
 
periwinkleCommented:
What happens when you run the .bashrc from the command line AFTER logging in - does it work properly?
0
 
balromAuthor Commented:
Thanks Pierwinkle, the script was correct, it simply must be called ".profile" (retrived in google).

I will ask for a points refund.

Regards

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.