Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (3) </ 1 [2] 3 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Aliases, Scripts seems to ignore them.< Next Oldest | Next Newest >
pr0f3550r Offline





Group: Members
Posts: 378
Joined: Dec. 2005
Posted: June 16 2006,15:12 QUOTE

If you put all aliases in one file, eg .alias, then you can start your favourite apps from a bash script, lke this:
Code Sample

#!/bin/bash
#make sure you start this from aterm, not the root console

source $HOME/.alias
path/to/graphical-application &


--------------
THE QEMU FORUM: http://qemu.dad-answers.com/index.php

QEMU ON WINDOWS: http://www.h7.dion.ne.jp/~qemu-win/

How to use floppy, CD-ROM and hard disk - http://www.h7.dion.ne.jp/~qemu-win/HowToFloppyCdrom-en.html

How to use network - http://www.h7.dion.ne.jp/~qemu-win/HowToNetwork-en.html
Back to top
Profile PM 
Zucca Offline





Group: Members
Posts: 524
Joined: Feb. 2006
Posted: June 17 2006,10:59 QUOTE

Guys guys.

Maybe you understand my problem if I show part of my .bashrc file for you:
Code Sample
   alias ll="ls -lhaFC"
   alias reboot="sudo shutdown -r +5 "
   alias fastreboot="sudo shutdown -r now Brb. Sorry."


No. I do NOT use these aliases in scripts. I just want to add some aliases to make few things faster.

I wonder what I did wrong...
One thing more: dir alias seems to work. O.o If that works, why doesn't my aliases as they are definied just after dir alias?


--------------
Do you have it? - http://dy.fi/mak
Back to top
Profile PM WEB ICQ MSN 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: June 17 2006,14:10 QUOTE

If you make changes to .bash_profile, they will not be applied until you either log out and back in again, or exit X and source /home/dsl/.bash_profile.

The .bash_profile file is run only for login shells, which in DSL means that it is run only once, when you first log in.  For this reason I recommend adding aliases to .bashrc instead, and source that file from .bash_profile.  In this way, every shell will have access to the aliases, and changes will not require re-sourcing for anything but the currently opened shell(s).

The suggestion made by the professor will work as well, though you will need to source the file from .bashrc AND source either .alias or .bashrc from .bash_profile in order to apply aliases to all shells. It is, however, a very useful method of setting alias groups, to have different sets of aliases at different times.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
Zucca Offline





Group: Members
Posts: 524
Joined: Feb. 2006
Posted: June 17 2006,16:16 QUOTE

Yes. I got that too while reading some manuls... But the solution to this problem...
I'll try that soucing method...


--------------
Do you have it? - http://dy.fi/mak
Back to top
Profile PM WEB ICQ MSN 
Zucca Offline





Group: Members
Posts: 524
Joined: Feb. 2006
Posted: June 17 2006,16:41 QUOTE

Thanks guys. :D
source command worked just fine...

Is the source command just like 'include' in PHP?


--------------
Do you have it? - http://dy.fi/mak
Back to top
Profile PM WEB ICQ MSN 
12 replies since June 16 2006,02:59 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (3) </ 1 [2] 3 >/
reply to topic new topic new poll
Quick Reply: Aliases

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code