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.
open file
Name: carlos Date: December 10, 2001 at 15:27:00 Pacific
Comment:
How can I in a Shell Script open a file, read and process an specific part of it ?
Name: ramzi Date: December 10, 2001 at 20:16:49 Pacific
Reply:
To manually read and edit a file on the standard output:
#script begins ... vi $file # where file is the file name you want to # work on ... #script ends
To programmatically read and edit a file, e.g. to change harsh words into something else. In this example, lets consider "bad" is a harsh one and lets change any occurance of "bad" in the file (off course a text file) into "bxx":
# scripts begins # this script expects a file name as an # argument ... if [ -f $1 ] then cat $1 | sed 's/ bad / bxx /g' > $1.new fi ... # scripts end
my humble suggestion does not necessarily meet your requirement.
0
Response Number 2
Name: carlos Date: December 11, 2001 at 04:07:40 Pacific
Summary: How can I find the open files in Unix server? I have 20 Win XP machines connected to Unix server. I want to know which user has what files open? Appreciate the help Thanks dan Klavil ...
Summary: Does anyone know how to run backup without having it return an error (>0)if it encounters an open file. Currently I am doing the backup by "find . | backup.." I know that some of the files are open,...
Summary: I have a unix volume(AIX4.2) mounted on NDS Netware 4.1. and mapped to a drive. In windows 95 or NT4, i can open text/csv etc files in wordpad, but to open them with office 97 apps, i need to open the...