Solved

Correct use of .bashrc file

Posted on 2006-06-22
9
591 Views
Last Modified: 2013-12-16
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
0
Comment
Question by:balrom
  • 4
  • 3
9 Comments
 
LVL 15

Expert Comment

by:periwinkle
ID: 16959208
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
 

Author Comment

by:balrom
ID: 16959247
Thanks pieriwinkle,
it seems that the .bashrc script is not be executed.
Are there some settings wrong?
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 16959276
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
 

Author Comment

by:balrom
ID: 16959764
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:balrom
ID: 16959799
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
 
LVL 15

Expert Comment

by:periwinkle
ID: 16960165
What happens when you run the .bashrc from the command line AFTER logging in - does it work properly?
0
 

Author Comment

by:balrom
ID: 17037078
Thanks Pierwinkle, the script was correct, it simply must be called ".profile" (retrived in google).

I will ask for a points refund.

Regards

0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 17075430
Closed, 50 points refunded.
Netminder
Site Admin
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now