wood burning stoves 2.0*
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
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
 
Similar Threads
Problem in Debug mode only, works in Run mode!
imports
Forum on Java Glossary
pkcs12
Forum on Java Glossary