Welcome to the most active Linux Forum on the web.
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!


  Search this Thread
Old 04-23-2009, 11:45 PM   #1
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704

Rep: Reputation: 55
writing data or text to a file using shell scripting

hi experts....

Can anyone help me please how to write data or text to the particular line in a file using shell script....

Thanks in advance....
Old 04-24-2009, 12:13 AM   #3
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704

Original Poster
Rep: Reputation: 55
Its very helpful....Thanks a lot......
Old 04-24-2009, 12:16 AM   #4
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Also read the section of the bash info manual dealing with HERE documents. This is a method of creating text files by having the text in the bash file itself. It can use variables that are expanded when the file is created.

Also look at the bash printf command which uses the same arguments as the C printf() function.


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
Writing value to a file using shell scripting Keshav murthy Programming 4 09-25-2008 04:26 AM
how to change some text of a certain line of a text file with bash and *nix scripting alred Programming 6 07-10-2006 11:55 AM
how to send shell variable data to a text file ginda Programming 7 06-23-2006 05:49 AM
Bash Scripting help, altering data in text file. trey85stang Linux - General 4 05-31-2006 05:18 AM
Reading text from a file using shell scripting. mrobertson Programming 11 06-29-2005 12:12 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:51 AM.

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