Results 1 to 10 of 13
I read through the content on how to make permanent alias on computer. I added alias in .bashrc file. But after log out then log in, it still could not ...
- 12-08-2006 #1Just Joined!
- Join Date
- Dec 2006
- Posts
- 7
how to make permanent alias on nodes?
I read through the content on how to make permanent alias on computer. I added alias in .bashrc file. But after log out then log in, it still could not remember that. What i should do? Is there anything else i could try? thanks a lot.
- 12-09-2006 #2Well, that should work. Maybe you could post the exact alias command you put in ~/.bashrc.I added alias in .bashrc file. But after log out then log in, it still could not remember that.
- 12-13-2006 #3Just Joined!
- Join Date
- Dec 2006
- Posts
- 7
Hi, in fact, i did that. In .bashrc file, i added following things:
alias rupme='echo `hostname -s` `uptime`'
alias rupall=rcom rupme
then saved it then logged out. But when i logged in again, it could not work.
- 12-13-2006 #4
Does the rupme alias at least work? If you typed it just like that (no typos), it looks correct.
The rupall alias will not work. First, you need to single-quote the two commands. Second, what is rcom? A command or another alias?
After logging in, type the alias command without arguments. It'll show you which aliases are currently in place for you.
- 12-14-2006 #5Just Joined!
- Join Date
- Dec 2006
- Posts
- 7
well, rcom is the command used for controlling nodes connected to main computer. I used single quote when writing alias command, but i did not write it correctly in posting news in this forum. Sorry for my mistake. But anyway, it could not work. It has no memory. There was once i asked my advisor who suggested that it could be related to my system. The nodes used system a little different from my main computer.
- 12-14-2006 #6
I should have asked this earlier, but what shell are you using? echo $SHELL
Doing an alias with the csh-based shells is a little different.
Also, could you post the results of the alias command and the exact contents of your ~/.bashrc file?
- 12-15-2006 #7Just Joined!
- Join Date
- Dec 2006
- Posts
- 7
I forgot to past the content after i used rupall alias on my main computer just now. It is like following:
bash: rupme: command not found
bash: rupme: command not found
bash: rupme: command not found
Could it help by any way?
- 12-15-2006 #8Sure - it demonstrates that there is no alias for 'rupme' and no command called that either.Could it help by any way?
Could you post your ~/.bashrc file?
- 12-16-2006 #9Just Joined!
- Join Date
- Dec 2006
- Posts
- 7
One thing i found is that, i could not use echo $shell on my main computer or nodes for it responded blank. The following is the content of .bashrc file:
# .bashrc
# User specific aliases and functions
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# configuration file - MASTER NODE ONLY
# Environmental variables
CVS_RSH="ssh"
CVSREAD="read"
CVSROOT=":ext:zhangl@***.***.***.***:/home/cvs"
export CVS_RSH CVSREAD CVSROOT
export CUPS_SERVER=strada.***.***.***
alias uptodate='cvs status . | grep status | grep -v "Up-to-date"'
# Aliases for use on all machines.
alias ls='ls --color=tty -F'
alias dir='ls -al'
alias dirss='ls -alF | grep "/"'
alias new='ls -alFt | head'
alias strada='ssh -X strada'
alias rupme='echo `hostname -s` `uptime`'
alias rupall='rcom rupme'
alias cp='cp -i'
alias grep='grep -i'
alias mv='mv -i'
alias rm='rm -i'
I don't know if it can help.
- 12-17-2006 #10
It's strange, yanyan. The alias
is syntactically legit .Code:alias rupme='echo `hostname -s` `uptime`'
Let me ask a different question: Do the commands hostname -s and uptime work from the command line?
P.S. (bash, sh) env variables are generally upper case. You need to use echo $SHELL


Reply With Quote