Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Modifying a file in KSH
Name: abby Date: July 10, 2002 at 11:54:08 Pacific
Comment:
Hi all, I'm trying to modify a file using ksh script. I need to parse the file and then look for a specific occurence of a pattern and then assign it a value. After that I need to save the file with the same filename. Is there any way to accomplish it without creating a temporary file ? For modification, which is a better bet (sed/awk) ? Thanks in advance.
Name: Frank Date: July 11, 2002 at 07:06:05 Pacific
Reply:
Hi abby,
it is unusal for unix commands to overwrite him self. So choose C, C++.
No RISK no fun Frank
0
Response Number 2
Name: Faraz Rehman Date: July 17, 2002 at 11:41:11 Pacific
Reply:
Frank,
Seems like you wanna do "Search and Replace" operation on a text file right? For example if you want to find every single occurrence of "string_1" in "my_file" and replace it with "string_2" you might try following
Summary: i want to replace a file in .zip file in AIX5.3 machine; say i have file script.ksh file and a build.zip file which contains older version of script.ksh. i dont want to zip the entire thing. i want to...
Summary: I want to send an attachment in a mail, in a unix script mail -s "subject" user@outlook How can i attach a file in the e-mail. Any advice will be greatly apreciatted. ...
Summary: Any way of getting the modified timestamp of a file in the format I want, say dd/mm/yyyy hh24:mi:ss format, irrespective of when the file is last modified. I'm working on SunOS 5.5.1 Thanks. ...