I am using solaris 10 x86. I have created a .bash_profile under root's home directory(/). The contents of the file are:
Solaris10u8/# cat .bash_profile
export PATH=$PATH:/usr/sfw/bin
export PS1='\h\w\$ '
export PAGER="less -imsq"
alias ll='ls -l'
alias la='ls -a'
The problem is that:
Everything in the file executes properly except the alias lines.
When i run "ll' or "la" from bash prompt(root's shell) i get the following error:
bash: ll: command not found
bash: la: command not found
What is the problem out here? I cant sort it out.
Only after sourcing the .bash_profile file that 'll" and "la" work.
Hi proactiveaditya,
Just a guess here ...
I've always been using double quotes (") instead of single (') quotes when it comes to aliases in a .bash_profile
Might want to give it a shot.
Changed .bash_profile to
Solaris10u8/# cat .bash_profile
export PATH=$PATH:/usr/sfw/bin
export PS1='\h\w\$ '
export PAGER="less -imsq"
alias ll="ls -l"
alias la="ls -a"
But still not working.
I have to ask it, you logged out and then back in ?
yes i did that to make the changes take effect.
can you run below and try ll command again
bash -l
The contents of .bash_profile should be like this:
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
export PATH=$PATH:/usr/sfw/bin
export PS1='\h\w\$ '
export PAGER="less -imsq"
And the content of .bashrc should be:
alias ll='ls -l'
alias la='ls -a'