Computing.Net > Forums > Unix > creating one file from multiple

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!

creating one file from multiple

Reply to Message Icon

Original Message
Name: Hamim
Date: December 3, 2003 at 23:32:48 Pacific
Subject: creating one file from multiple
OS: Sco Openserver
CPU/Ram: Pentium2/512meg
Comment:

Hi,
I need to have a script that will apend all outputs everyday to a single file.
my script:
DATE=/home/myfile.txt
netstat -A |wc -l >>$DATE

this will count all established links everyday to a file,but the problem is it puts it to seperate files everyday when I run it in the cron


Report Offensive Message For Removal


Response Number 1
Name: Anagram
Date: December 5, 2003 at 11:58:40 Pacific
Reply: (edit)

More details please. What are the names of these "different files"? What is the path to them?

I recommend starting out by eliminating the variable. Just do:

netstat -A | wc -l >> /home/myfil.txt

If that works then most likely you have some sort of conflict with the environment variable "DATE".


Report Offensive Follow Up For Removal

Response Number 2
Name: Hamim
Date: December 8, 2003 at 22:20:29 Pacific
Reply: (edit)

The file name are the same
eg est0308,est0309,est0310

08 ,09 & 10 are the dates
I donot want to create multiple files
I want it to apend to a single file ,having all the establibshed links together,so that I can put it into excel.
thanks


Report Offensive Follow Up 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