allias in .bash_profile not working


 
Thread Tools Search this Thread
Operating Systems Solaris allias in .bash_profile not working
# 1  
Old 08-03-2010
allias in .bash_profile not working

I am using solaris 10 x86. I have created a .bash_profile under root's home directory(/). The contents of the file are:
Code:
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:
Code:
bash: ll: command not found

Code:
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.
# 2  
Old 08-03-2010
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.
# 3  
Old 08-03-2010
Changed .bash_profile to
Code:
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.
# 4  
Old 08-03-2010
I have to ask it, you logged out and then back in ?
# 5  
Old 08-03-2010
yes i did that to make the changes take effect.
# 6  
Old 08-03-2010
can you run below and try ll command again
Code:
 
bash -l

# 7  
Old 08-03-2010
Try it as .bashrc
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Renaming .bash_profile to .profile

Hi Gurus, Recently we have migrated our servers from AIX to Linux. Most of the scripts written in AIX server are sourcing environment variables using .profile file. Now we have the following options: 1. Change all the scripts where ever .profile is being used and replace it with... (14 Replies)
Discussion started by: svajhala
14 Replies

2. UNIX for Dummies Questions & Answers

.bash_profile question

Hello everyone, I'm trying to set my .bash_profile to change my primary prompt from this: banbatchtest1v:MCPPRD:~>to this: banbatchtest1v:MCPPRD:/home/rcarvall> Here's what my .bash_profile looks like right now: # .bash_profile # Get the aliases and functions if ; then .... (2 Replies)
Discussion started by: galileo1
2 Replies

3. Shell Programming and Scripting

Is there a way to organize bash_profile across different platforms

I want to have one .bash_profile works on multiple platform, ubuntu, debian, redhat, cygwin, osx. So how should I organize .bash_profile? It can be multiple files in some subdir Let me brief you: what i want is a way to organize bash_profile across platforms so I can use one set of profiles... (2 Replies)
Discussion started by: John_Peter
2 Replies

4. Shell Programming and Scripting

Add Variable in .bash_profile

Hi, I wanted to do the following, but the command does not seem to work. Any ideas or suggestions please help. #1. If the particular ENV variable IMPACT_HOME is not there in a file grep -q IMPACT_HOME infile || sed -i 'i IMPACT_HOME=/my/new/path' infile #2. If the ENV variable... (4 Replies)
Discussion started by: dbashyam
4 Replies

5. UNIX for Advanced & Expert Users

bash_profile or .profile

Hi, happy new year. on AIX 6.1 , for user oracle , there are two files : bash_profile and .profile I do not know which one is executed when login ? How to know , More over in both of them we have : in .profile : ORACLE_HOME=/appli/oracle/product/10.2.0/db_1... (5 Replies)
Discussion started by: big123456
5 Replies

6. UNIX for Dummies Questions & Answers

bash_profile does not working

Hi all. when i connect as user megaguru i have a problem my .bash_profile does not working^:( if i do: . ./.bash_profile all enviroment variables are in place. How can i force linux to use .bash_profile before logon process? thanx in advance. (1 Reply)
Discussion started by: smallman
1 Replies

7. Shell Programming and Scripting

question in .bash_profile

We are more users using the oracle account, and people want to include theyr own files in .bash_profile. Like this: while ; do echo -n "LOGNAME is '$LOGNAME' (no sens), who are you? " >/dev/stderr read ln export LOGNAME=$ln done This works well when logging in to... (1 Reply)
Discussion started by: hannem
1 Replies

8. Shell Programming and Scripting

.bash_profile problem

Hi Guys, I modified my .bash_profile script , and tried to change the prompt. Following is the line of code in my .bash_profile script. export PS1=" \W " But I get the output as: \W This appears to be my prompt now. Any idea what should be done.. Thanks! (0 Replies)
Discussion started by: nua7
0 Replies

9. UNIX for Dummies Questions & Answers

Unrecognized Path in .bash_profile

Dear experts, I have installed Ruby in the following directory: $ pwd /home/ewijaya/.ruby $ ls bin lib share And I have also stated the PATH in my bash_profile like this: # .bash_profile # Get the aliases and functions if ; then . ~/.bashrc (1 Reply)
Discussion started by: monkfan
1 Replies

10. UNIX for Dummies Questions & Answers

storage of allias

Hi all... if i use allias for a particlular command where it stored actually ..Does it do stored in .profile. What will it be do when i make an entry foa allias in .profile Thanks, Arun. (1 Reply)
Discussion started by: arunkumar_mca
1 Replies
Login or Register to Ask a Question