![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| lame php question | rayne | Shell Programming and Scripting | 6 | 08-23-2006 04:41 AM |
| lame question | pgas | SUN Solaris | 4 | 02-20-2004 08:42 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
This is a long shot, but there are many bright folks on here
My next vi drama involves a using a prototype file for a makefile. I have an old prototype file but its not in correct format. It's formated as: /the/old/path/file1 <garbage> <garbage> /the/old/path/file2 <garbage> <garbage> . . I'm trying to format it into: f none /the/old/path/file1=../../the/old/path/file1 777 user group I've made a copy of the old file, removed <garbage> and whitespaces, and got everything I need left of the "=". Now I'm looking for a quick way to get the right side of the "=" formated correctly. Any help is appreciated Last edited by Yinzer955i; 09-11-2006 at 10:24 AM. Reason: too tired to type |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
This would be easier with sed but I got this to work in vim and I think that it will work in plain old vi:
:%s+\(/.*\)=+\1=../..\1 777 user group+ It will certainly work in sed: sed 's+\(/.*\)=+\1=../..\1 777 user group+' < inputfile > outputfile |
|
#3
|
|||
|
|||
|
It replied "Substitute pattern match failed."....but it's start...
I forgot to mention the all the files end with .src, but their names vary. So for example.... 65000.src 65010.src . . . Thanks. edit: Gonna give sed a try.......fingers crossed Last edited by Yinzer955i; 09-11-2006 at 12:02 PM. |
|
#4
|
|||
|
|||
|
Quote:
sed 's+\(data.*\)+\1=../../\1 777 user group+' < inputfile > outfile Many thanks! |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|