Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


Closed Thread
  Search this Thread
Old 06-08-2006, 09:20 AM   #1
LQ Newbie
Registered: Mar 2006
Location: India
Distribution: FC4
Posts: 11

Rep: Reputation: 0
Exclamation Unix script : Append to a file

I am trying to write a Unix script which does the following:

Append the

alias myserver='/usr/bin/myserver :$SOME_USERID -name $SOME_USERNAME'

to the end of a particular file.

Can anyone help me with doing this ?

I tried the following in my script file

echo "alias myserver='/usr/bin/myserver :$SOME_USERID -name $SOME_USERNAME'" >> .bashrc

But i am getting the following
invalid command name "echo"
while executing
"echo "alias

1. Why is this happening ?
2. Any other way to do the appending ?

Thanks in advance
Old 06-08-2006, 09:41 AM   #2
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Don't post in muliple forums; it's against the rules.
Old 06-08-2006, 02:12 PM   #3
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913
Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to run bat file from Unix script??? gopi_20us Programming 10 09-14-2010 10:15 AM
unix shell script:How to delete the first line in a file?? rche3252 Programming 6 03-03-2010 08:32 AM
Unix scrpting : Append to a file linux_newbee Programming 6 06-12-2006 09:02 AM
How to append hostname in a script anjaan Programming 5 06-14-2004 11:41 AM
How to append today's date in a script anjaan Programming 4 06-12-2004 09:37 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:04 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration