echo, append to end of file | Unix Linux Forums | Shell Programming and Scripting

  Go Back    

Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

echo, append to end of file

Shell Programming and Scripting

Closed Thread    
Thread Tools Search this Thread Display Modes
Old 09-15-2002
hachik's Avatar
hachik hachik is offline
Registered User
Join Date: Jun 2002
Last Activity: 28 February 2012, 3:22 AM EST
Location: Estonia
Posts: 68
Thanks: 2
Thanked 0 Times in 0 Posts
Question echo, append to end of file

I need the line printed with echo to append to eof of to exactly line, am i able to do that?
i mean
echo "sysctl -w lalala=1" > to end of file /etc/sysctl.conf
or to the 21st line, if the line exist, open new line and insert text there.
Thx.maybe i'm in wrong topic but anyway...
Sponsored Links
Old 09-15-2002
Posts: n/a
to echo to the end of a file use the >> instead of >

echo "sysctl -w lalala=1" >> /etc/sysctl.conf
Sponsored Links
Old 09-16-2002
Optimus_P Optimus_P is offline Forum Advisor  
flim flam flamma jamma
Join Date: May 2001
Last Activity: 24 March 2008, 9:43 PM EDT
Location: Chicago IL, USA
Posts: 1,006
Thanks: 0
Thanked 2 Times in 1 Post
FYI if you want the output of that command to be put at the end of the file use a forward tick `` in place of the double quotes "".
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to search and append words in the same file using unix scripting file operations gsreeni Shell Programming and Scripting 5 12-06-2011 02:14 AM
Script to check for the file existence, if file exists it should echo the no of modified days karthikeyan_mac Shell Programming and Scripting 2 08-03-2011 08:08 AM
Unix Script file to Append Characters before rows in file. phani333 Shell Programming and Scripting 4 05-24-2010 03:28 AM
Append && echo "success" to all commands dotancohen Shell Programming and Scripting 5 01-28-2010 08:23 PM
Append Status to echo'd line after process completes Setan Shell Programming and Scripting 5 01-25-2008 05:59 PM

All times are GMT -4. The time now is 02:08 PM.