Alias in solaris


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Alias in solaris
# 1  
Old 01-30-2010
Alias in solaris

Hi,
i need to create a alias in my solaris 10 , i have edited ~/.profile and added like
Code:
alias c='clear'

and exit the terminal and open again and checked to see working or not but it's still not working
# 2  
Old 01-30-2010
What type of shell are you running (echo $SHELL). If it's ksh, then what you've done should work unless there's a syntax error earlier in the .profile causing it to fail. If you're running bash, trying making the same change in your .bashrc file

HTH

---------- Post updated at 07:20 PM ---------- Previous update was at 07:17 PM ----------

Just re-read your post...your .profile is only processed when you login, so if you're opening a new terminal on a logged in work station, any changes you've made won't have any effect. Logout and login again.
# 3  
Old 02-01-2010
Quote:
Originally Posted by JerryHone
What type of shell are you running (echo $SHELL). If it's ksh, then what you've done should work unless there's a syntax error earlier in the .profile causing it to fail. If you're running bash, trying making the same change in your .bashrc file

HTH

---------- Post updated at 07:20 PM ---------- Previous update was at 07:17 PM ----------

Just re-read your post...your .profile is only processed when you login, so if you're opening a new terminal on a logged in work station, any changes you've made won't have any effect. Logout and login again.
Code:
bash-3.00$ vi ~/.
./                 .gconfd/           .icons/            .sunw/
../                .gnome/            .iiim/             .themes/
.bash_history      .gnome2/           .metacity/         .thumbnails/
.dt/               .gnome2_private/   .mozilla/          .Trash/
.dtprofile         .gstreamer-0.8/    .nautilus/         .Xauthority
.esd_auth          .gtkrc-1.2-gnome2  .profile
.gconf/            .ICEauthority      .recently-used

i don't see any bashrc in my home dir

---------- Post updated 02-01-10 at 02:07 PM ---------- Previous update was 01-31-10 at 09:42 PM ----------

need some help guys it's urgent

Last edited by pludi; 01-31-2010 at 01:01 PM.. Reason: code tags, please...
# 4  
Old 02-01-2010
How exactly can an alias for clear be important & urgent enough to validate a violation of Rule 4
Quote:
(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post or send a private message where your goal is to get an answer more quickly.
As for your question: if you don't have it, create it. .bashrc is a simple bash script, the only difference to a regular script is that it's read for every new interactive shell. A minimal would look like this:
Code:
if [ -r ~/.aliases ]
then
    . ~/.aliases
fi

which would read your alias from the ~/.aliases file (as soon as you put it there).
# 5  
Old 02-01-2010
echo "alias ll='ls -la'" >> /etc/profile
# 6  
Old 02-01-2010
Quote:
Originally Posted by pludi
How exactly can an alias for clear be important & urgent enough to validate a violation of Rule 4
My bad Will never do that again

---------- Post updated at 10:59 PM ---------- Previous update was at 10:41 PM ----------

Quote:
Originally Posted by pludi
if you don't have it, create it. .bashrc is a simple bash script, the only difference to a regular script is that it's read for every new interactive shell. A minimal would look like this:
Code:
if [ -r ~/.aliases ]
then
    . ~/.aliases
fi

which would read your alias from the ~/.aliases file (as soon as you put it there).
I've created the .bashrc file inside the file i've placed you're code and i've created another file ~/.aliases and have the following line
Code:
c='clear'
ls='ls -ltr'

i've logged out and looged in but still not working
# 7  
Old 02-01-2010
The .aliased file will be sourced, so it has to be a valid shell script. That means you can't skip on declaring an alias explicitly as such.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

IP Alias

Quick question Have a AIX system that has been up for years with a 192.9.x.x IP scheme and we want to add a second IP to the system. I setup the second IP 10.1.x.x as an alias via smit. Since these two IP's are on different VLANs will this be an issue? Reason I ask is that I cannot ping... (3 Replies)
Discussion started by: Chrisp
3 Replies

2. Solaris

How to set a global alias in UNIX Solaris?

Defined a user alias in unix. Not able to use that alias in a ksh scritp. I dont want to change/source in the script to set the value. Need to set the user alias as a gloabal alias to use it in a new ksh shell window. Can you please help on this? (3 Replies)
Discussion started by: rbalaj16
3 Replies

3. Shell Programming and Scripting

Not able to create alias in bash Sun solaris

Hello Friends, I am facing problem in creating aliases. I am working in SunOS 5.10. When I login in system i have been given ksh shell. What i am doing is that ? I am changing shell to bash then I am creating 2 alias in command prompt like: alias deploy_dir=' cd... (4 Replies)
Discussion started by: krsnadasa
4 Replies

4. UNIX for Dummies Questions & Answers

Create alias files (not alias commands)

If one: $ find -name 'some expression' -type f > newfile and then subsequently wants to create an alias file from each pathname the find command retrieved and the > placed within 'newfile', how would one do this? Ideally, the newly created alias files would all be in one directory. I am... (3 Replies)
Discussion started by: Alexander4444
3 Replies

5. Solaris

Alias setting in Solaris

Hi All, I need some information on 'Alias' setting in SUN SOLARIS.:confused: Q1. I want to know how can i set my alias here. Q2. How to view all set 'ALIAS' for me. (say /home/jdash user) Q3. Can i modify the set 'Alias' for me or for whole environment. Q4. Is Alias setting can be change... (2 Replies)
Discussion started by: jdash.ps
2 Replies

6. UNIX for Dummies Questions & Answers

alias

Hi, I have created alias in UNIX environment (ie in .cshrc file). But when i use the alias in the UNIX script, getting an error message as that is not found. But when i use that alias, outside the script it is working fine. Let me know if you need more details For example: alias cderror... (6 Replies)
Discussion started by: Naveen_5960
6 Replies

7. UNIX for Dummies Questions & Answers

Help with Alias

Hi, I have a software package consisting of a group of BASH shell scripts. There is a master script which calls a series of subscripts. To run the software users must open the master script, modify and save it, and then run it. To open the script you can either double-click on it, or you can... (2 Replies)
Discussion started by: msb65
2 Replies

8. UNIX for Dummies Questions & Answers

alias help

Hello again, what does \!* do int his line alias lookup 'grep -i \!* who.is.who' Thanks! (1 Reply)
Discussion started by: kris888
1 Replies

9. Filesystems, Disks and Memory

alias

Hello, I'm trying to create an alias that will show the path name of a current directory when a user cd's into any directory. I have tried the following: alias cd ' cd | pwd ' This just lists the current directory, even when I cd to another directory the alias just lists my home... (6 Replies)
Discussion started by: klannon
6 Replies

10. UNIX for Dummies Questions & Answers

Alias

Hello, I'm a beginner to Unix and I want to create an alias that lists the given directory in long format; the alias should use a pager to display the result. Thanks in advance. (2 Replies)
Discussion started by: guelpth
2 Replies
Login or Register to Ask a Question