alias command within .profile


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers alias command within .profile
# 8  
Old 09-17-2009
Make this entry in your login script.
Code:
alias cls="clear"

log in script differs shell to shell. For example bash the log in script .bashrc and for ksh the log in script is .profile. So please verify what is your log in script and set the alias there.
# 9  
Old 09-17-2009
ok. I put that line in .profile, because I'm using ksh, I log out and log back in, but I get this:

ksh:cls: not found

Is there a specific place in .profile I need to put it?
# 10  
Old 09-17-2009
Please post the output from "alias" with no parameters after logging in. Maybe you have aliased "alias" itself.
# 11  
Old 09-17-2009
The only thing having to do with alias is

hash='alias -t -'

and none of my aliases show up.
# 12  
Old 09-17-2009
Clutching at straws: Can you post the output from this command which is to confirm exactly what is in the .profile file:

Code:
sed -n l .profile

# 13  
Old 09-17-2009
$
$
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:/usr\
/local/bin$
TMOUT=3600$
TIMEOUT=3600$
$
export PATH TMOUT TIMEOUT$
$
$
if [ -s "$MAIL" ] # This is at Shell startup. In normal$
then echo "$MAILMSG" # operation, the Shell checks$
fi # periodically.$
# If termdef command returns terminal type (i.e. a non NULL value),$
# set TERM to the returned value, else set TERM to default lft.$
TERM_DEFAULT=lft$
TERM=`termdef`$
TERM=${TERM:-$TERM_DEFAULT}$
MYHOST="`/usr/bin/hostname`"$
PS1='[$USER@$MYHOST] $PWD # '$
export TERM MYHOST PS1$
[ -x /usr/bin/ksh ] && exec ksh -o vi$

# aliases
alias cls='clear'$
. ./first.aliases$
# 14  
Old 09-17-2009
No funny characters in the file. However nothing will more happen in .profile after the "exec" line because it starts a new shell.

Quote:
[ -x /usr/bin/ksh ] && exec ksh -o vi
The aliases you see came from ksh itself.


I can't see a simple way of setting more aliases in this context while retaining the "-o vi" option. The "-tx" switch to alias looks promising. No time to try it now.

Perhaps another poster in another timezone can help.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

SUDO help with command alias

Hi there, I'm trying to setup sudo privileges for a user, Oracle in this case, to run Unix commands like mv,chmod, chown, mkdir, rmdir against their own set of commands or scripts. Is there an easier way to do this than to give Unix commands for each of their respective commands as shown below... (2 Replies)
Discussion started by: mbak
2 Replies

2. UNIX for Dummies Questions & Answers

Alias does not work with bash profile

Hi, Below is what i have in my profile: alias wldm='cd /opt/app/wls' If i use bash or ksh shell this alias does not work. What should be done for this alias to work with all these simultaneously -> No Shell, bash shell, and ksh shell (14 Replies)
Discussion started by: mohtashims
14 Replies

3. Homework & Coursework Questions

Creating a .profile, displaying system variables, and creating an alias

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Here is what I am supposed to do, word for word from my assignment page: 1. Create/modify and print a... (2 Replies)
Discussion started by: Jagst3r21
2 Replies

4. Shell Programming and Scripting

Alias command help

Hello, I'm attempting to configure shell settings in my new Macbook. The standard unix command line 'alias' doesn't seem to be working: bash-3.2$ alias dir ls -la bash: alias: dir: not found bash: alias: ls: not found bash: alias: -la: not found bash-3.2$ alias dir 'ls -la' bash:... (1 Reply)
Discussion started by: palex
1 Replies

5. UNIX for Dummies Questions & Answers

Alias /usr/bin to /bin in profile

Hi! All the basic linux commands, ie. echo, find, etc, are located in /bin. I have a couple of programs that have these commands pointed towards /usr/bin, ie, /usr/bin/echo (even though the actual 'echo' command is in /bin). How can I alias or redirect or link the /usr/bin to /bin just for this... (6 Replies)
Discussion started by: dancerat
6 Replies

6. OS X (Apple)

Problem using a top command alias in my profile

Hi- I am newish to the mac osx unix interface. I want to set up top so that it always displays the username. I can use this command to do this: top -ocpu -P ' PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD RSIZE VSIZE USER' -p '$aaaa ^bbbbbbbbb $cccc $wwwwwww $ee... (1 Reply)
Discussion started by: mikey11415
1 Replies

7. UNIX for Advanced & Expert Users

All alias in .profile lost when "script" command is called

Hi, I was trying to call "script <an ip add>" command from .profile file to log everything whenever anyone logs in to this user. I did the following at the end of .profile. 1) Extracted the IP address who logged in 2) Called script < ip add> . The problem I am facing is all, aliases etc. written... (3 Replies)
Discussion started by: amicon007
3 Replies

8. UNIX for Advanced & Expert Users

Alias a command

Hi 'm executing a java program from my shell script on solaris 9 as $JAVA_HOME\bin\java -ms32m -mx128m -classpath $CLASSPATH com.abc.fwk,abcServer.abcfwkServer $1 & where $1 is port number when i do ps -ef, it shows whole command , i want to give this some alias name as abcProcess, so... (2 Replies)
Discussion started by: b_garima
2 Replies

9. UNIX for Advanced & Expert Users

alias for rm command

Hi, i want to make alias for rm command. It should actually move the file to a directory in my home. Say if i type %rm abc.txt the command should expand to %mv abc.txt ~ashishp/trash How should I write the alias for this? -Ashish (8 Replies)
Discussion started by: shriashishpatil
8 Replies

10. UNIX for Dummies Questions & Answers

alias in .profile

hello guys... im just new in using unix and im trying to create a command by using an "alias" and incoporating it in my .profile. how can i make a command that will do a chmod 775 on all files only under my username. i tried alias gochmod="chmod 775 $PUROOT/path/*" but this gives me... (3 Replies)
Discussion started by: davinxi
3 Replies
Login or Register to Ask a Question