Computing.Net > Forums > Unix > saving altered file in script

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

saving altered file in script

Reply to Message Icon

Original Message
Name: Niall21
Date: March 7, 2006 at 12:39:51 Pacific
Subject: saving altered file in script
OS: unix
CPU/Ram: ?
Manufacturer/Model: ?
Comment:

I have a script that inputs a line into the first line of a text file using sed:
sed '/1i\
'$LINE'' <$FILE

FILE and LINE are inputted using read.
My problem is that I want to save the file once this line is entered. I cannot get the write command (w FILENAME) to work. Any suggestions?


Report Offensive Message For Removal








Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge
Poll History




Data Recovery Software