File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes Aliases within a script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Aliases within a script" Watch "Aliases within a script" New topic
Author

Aliases within a script

minal silimkar
Ranch Hand

Joined: Nov 25, 2007
Posts: 133
I want to add aliases within sript.
I added

alias lm='ls -i | more'

in .bash_profile file.

but it is not working........


Minal Silimkar
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

Add it in $HOME/.bashrc and do


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
minal silimkar
Ranch Hand

Joined: Nov 25, 2007
Posts: 133
I added
alias lm='ls -l | more'
in .bashrc file but after giving command "lm" it is showing command not found.
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

Adding it in the .bashrc should do the trick unless you don't use bash shell at all.

Did you do

from your terminal?

The source command only affects the current terminal where you issued that command and all the new terminal opened that you're going to open later on. The other existing terminals won't be affected by the changes. You need to close them first.

But you can always restart the OS to reflect the changes.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Aliases within a script