Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: Setting up aliases outside .bashrc

houghi wrote:

> Arne Schmitz wrote:
>> houghi schrieb:
>>
>>> Just wondering. The second (my) solution is already standard in .bashrc.
>>> The first solution is not. How is the second solution easier then the
>>> first. With the second, the only thing you have to do is add .alias in
>>> your homedirectory.
>>
>> True. I thought he might want also do some other things that do only work
>> with sourcing.
> 
> Sure. The only difference as far as I can see) is that the standard puts
> a test in front of it. Not a bad idea. I did it in another script like:
> 
> OK=NOTOK
> if [ -e "/etc/radiostreamrc" ]
> then
>         . /etc/radiostreamrc
>         OK=OK
> fi
> if [ -e ~/.radiostreamrc ]
> then
>         . ~/.radiostreamrc
>         OK=OK
> fi
> if [  "$OK" != "OK" ]
> then
> <snip making a file ~/.radiostreamrc>
> 
> What it does is first make /etc/radiostreamrc the default. Next it makes
> ~/.radiostreamrc the default, overwriting the first one. And if non of
> these two are availbel, it makes a new one.
> 
> Later you can just edit ~/.radiostreamrc. No need to download two files.
> 
> It might be a bit complicated in scripting, but it works. The complete
> source is here:
> http://houghi.org/script/radiostream.sh and you need zenity installed as
> well.
> 
> I also use `. ~/.passwords` in scripts. That way I put my passwords in
> there, chmod it to 600 and I can still share scripts easily without
> being afraid of sharing my passwords.
> 
> It looks like:
> 
> # Different passwords. Chmod to 600
> IP_login=login1
> IP_password=Password1
> FTP_login=login2
> FTP_password=Password2
> 
> In a script I then just use:
> . ~/.passwords
> echo $IP_login $IP_password
> 
> There probably are more secure ways to do this.


Please allow me to clafiry. Sorry about the delay between replies...

Now that I reread Houghi continuing discussion, it seems like a .alias file
is the better solution, but I stuck to the one which worked quickly for me. 

However, I ought to mention that I prefer to centralise my settings outside
dot files. I get _everything_ apart from ~/.* backed-up (mirrored) twice a
week whereas all the remaining files I manage to back-up once a month or
so. .alias is yet another dot file to keep in mind.

My .bashrc is now just:


. /home/roy/Main/Programs/Scripts/Definitions/bashrc


the file above contains:



echo Setting up aliases...
echo

. /home/roy/Main/Programs/Scripts/aliases.sh


echo _______________________________________________________________
echo -------------------------- Last users -------------------------
echo

last -n 11

echo
echo _______________________________________________________________
echo --------------------------- Cron jobs -------------------------
echo

echo Currently omitted
### crontab -l

echo
echo
echo _______________________________________________________________
echo ------------------------------ Who ----------------------------
echo

who

echo
echo _______________________________________________________________
echo ------------------ roy@baine.smb.man.ac.uk --------------------
echo

all the rest of my customisations lie within /etc/profile.local and
/home/roy/Main/Programs/Scripts/aliases.sh


Thanks very much again,

Roy

PS - I checked your Web site, Houghi. Very nice!

-- 
Roy S. Schestowitz
http://Schestowitz.com

[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index