Solved

Correct use of .bashrc file

Posted on 2006-06-22
9
594 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.

773 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