Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Correct use of .bashrc file

Posted on 2006-06-22
9
601 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

861 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