Download your favorite Linux distribution at LQ ISO.
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 03-03-2007, 02:55 AM   #1
LQ Newbie
Registered: Mar 2007
Posts: 1

Rep: Reputation: 0
How to write in to a file using scripts..??

Can anybody help me with writing some thing in to a file using Shell scripts or pearl scripts?
Is there any commands used for these operations?
Old 03-03-2007, 03:18 AM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
You need to provide more details on what you want to do. To simply create a file you can use redirection ( > file or >> file2). The first creates a new file or zeros an existing file before writing. The send appends to the end of a file. You can also use sed or awk to edit a file based on patterns in the file. Sed and awk are often used to change a parameter in a config file.

You might want to go to the web site.

When it comes to perl, look for the website for a list of mirrors. They probably have lots of documentation.


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
Can anyone write scripts good? schranky54 Linux - Newbie 11 04-19-2006 05:55 PM
Can i write Lilo scripts? em00guy Linux - Software 2 07-14-2005 03:47 PM
I have some scripts that I need to write.... Meekal Programming 2 12-05-2004 04:03 PM
Some scripts I need to write.... Meekal Linux - General 1 12-05-2004 04:01 PM
Write-protection in scripts Louis_Carole Linux From Scratch 1 09-02-2004 11:22 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:14 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