?
Solved

Correct use of .bashrc file

Posted on 2006-06-22
9
Medium Priority
?
626 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
8 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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
 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month16 days, 16 hours left to enroll

862 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