Mailinglist Archive: opensuse (882 mails)

< Previous Next >
Re: [opensuse] .bashrc tip for managing multiple boxes, multiple user configs
  • From: "David C. Rankin" <drankinatty@xxxxxxxxxxxxxxxxxx>
  • Date: Thu, 30 Dec 2010 16:04:44 -0600
  • Message-id: <4D1D01FC.5050801@xxxxxxxxxxxxxxxxxx>
On 12/30/2010 11:21 AM, David C. Rankin wrote:
Basically, the setup allows the use of 1 .bashrc file among all boxes
and users
and all you have to remember to do is rsync the /home/admin/cnf dir between
boxes (or where ever you would put that kind of stuff on your box) Then when
changes are needed, you simply edit a singe ../cnf/ file and
the change to hosts and not have to edit 50 individual bashrc files.

You can also handle multiple distributions fairly easily by looking at the
/etc/xxxx-release file. Here is an example of a couple of aliases for log file
name handling between Arch and openSuSE:

[[ -e /etc/arch-release ]] && {
alias tmsg='tail -n150 /var/log/everything.log'
alias tmsgf='tailf /var/log/everything.log'
# <snip>
[[ -e /etc/SuSE-release ]] && {
alias tmsg='tail -n150 /var/log/messages'
alias tmsgf='tailf /var/log/messages'
# <snip>

If you do anything from a host specific standpoint, then hostname conditionals
also work fine:

[[ $HOSTNAME == nirvana ]] || [[ $HOSTNAME == archangel ]] && alias
sdns='cat /var/named/dyn/'

(** cheezy 'show dns' forward zone dump)

...and for those wondering "why all the effort to set your favorite aliases?"
Answer: once you have your top 20 or so tasks reduced to 3 or 4 char aliases,
you will really see what people mean when they talk about the power and
efficiency of the command line. There is no limit to what you can do... Combined
with the tabbed interfaces in konsole or gnome-terminal, you can cover a great
deal of ground in a very short time.

David C. Rankin, J.D.,P.E.
Rankin Law Firm, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
Telephone: (936) 715-9333
Facsimile: (936) 715-9339
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >