Unix scrpting : Append to a file
I am trying to write a Unix script which does the following:
Append the Code:
alias myserver='/usr/bin/myserver :$SOME_USERID -name $SOME_USERNAME' Can anyone help me with doing this ? I tried the following Code:
echo "alias myserver='/usr/bin/myserver :$SOME_USERID -name $SOME_USERNAME'" >> .bashrc invalid command name "echo" while executing "echo "alias
Thanks in advance |
You've apparently defined an alias for echo. To display all your aliases:
alias To remove an alias (also remember to remove it from any scripts executed at login): unalias echo |
The left slash prevents an alias expansion for the following command.
Code:
$ \echo "whatever..." |
No i am not trying to create an alias for echo. I am trying to create an alias for "myserver"
|
You're trying to do this right?
Code:
$ cat > file |
Yes.... this is what I am trying to do. This "file" is a script file. So i try to execute the file after i put the echo commands. but it gives me the error....
" invalid command name "echo" while executing " |
Quote:
What we are talking, is maybe, there is, for some reason, an incorrect alias to echo. try to put, as macemoneta pointed, "unalias echo", right before the echo "alias=whatever" in your script. |
All times are GMT -5. The time now is 01:32 PM. |