Thanks for your input MizzGail, but I'm afraid oombera is right... I'm not sure which script you refer to when you ask if it changes when it changes from one location to another... The idea is that the script stays the same and the only input the user should have, are the new pathnames in the config (.ini) files, which are entered when oombera's script asks for them.
Oombera, I tried your latest script and seems to have wiped the ini files and now they only contain LOC=/u/[DIR]/main... hehehe
and you have problems if the "this" ot "that" actually is a string that contains slashes. The sed s command does not require slashes. You can pick another character. Like this:
sed 's=this=that='
So just pick a delimiter character that is not used in the strings and now you have no backslash problem.
then it no longer erases the rest of the line, however it also inserts the user defined directory between the / and the pre-existing directory, instead of over-writing the existing....
Here's the deal, I have a file and it is of the following format:
HEAD SOME DATA 123456789
LINE DATA DATA DATA
LINE DATA DATA DATA
LINE DATA DATA DATA
HEAD SOME DATA 999999999
LINE DATA DATA DATA
LINE DATA DATA DATA
LINE DATA DATA DATA
HEAD SOME DATA 555555555
LINE DATA DATA DATA
LINE DATA DATA DATA
LINE DATA DATA DATA
Is there a script that will edit a file (which will be generated every night), take the number following 'HEAD' (see example) and add it to the start of every line which begins with the word LINE to make it look like this?
HEAD SOME DATA 123456789
123456789 LINE DATA DATA DATA
123456789 LINE DATA DATA DATA
123456789 LINE DATA DATA DATA
HEAD SOME DATA 999999999
999999999 LINE DATA DATA DATA
999999999 LINE DATA DATA DATA
999999999 LINE DATA DATA DATA
HEAD SOME DATA 555555555
555555555 LINE DATA DATA DATA
555555555 LINE DATA DATA DATA
555555555 LINE DATA DATA DATA
Thank you kindly
PS Everything in this file is fixed length and there are ALOT more fields that the example I use.