Kitara
07-17-2007, 11:29 PM
Hi, I need help. Can you please help me create a quick script that can do the following?
1. Delete all files in a specific directory
2. Call another perl script that will create an output file in the same directory I just deleted all the files from. (this perl script is already written...I just need to call it)
3. Open this newly created file, go to the top of the file, and write 1 line that says Server=hostname and then do a carriage return and then save the file.
I need hostname to be the value of the hostname of my linux server it's being ran on.
The file that is being opened, modified, and closed always has the same first 7 characters, but the rest are randomly generated.
I'd send a copy of what I have...but it's embarrassing. I am more of a hardware person, and coding is not my strong point. If someone could help me get started, I'd be very greatful!
Thank you!!
1. Delete all files in a specific directory
2. Call another perl script that will create an output file in the same directory I just deleted all the files from. (this perl script is already written...I just need to call it)
3. Open this newly created file, go to the top of the file, and write 1 line that says Server=hostname and then do a carriage return and then save the file.
I need hostname to be the value of the hostname of my linux server it's being ran on.
The file that is being opened, modified, and closed always has the same first 7 characters, but the rest are randomly generated.
I'd send a copy of what I have...but it's embarrassing. I am more of a hardware person, and coding is not my strong point. If someone could help me get started, I'd be very greatful!
Thank you!!