Help, while loop and sed not producing desired output
Hello everyone,
I need some assistance with what I thought would have been a very simple script.
Purpose of Script:
Script will parse through a source file and modify (search/replace) certain patterns and output to stdout or a file. Script will utilize a "control file" which will contain what to search for and what to replace it with. "Control file" will be used against the "source file".
Script Goals:
Comments (lines beginning with #) and blank lines in the "control file" should be ignored by the script. [DONE]
"Control file" will contain structured data. Deliminator with be initially a blank space, will be changed to a semi-colon. [DONE]
The script works [This is where I need help]
Example of "Control file"
Example of "Source file"
Example of the script
Example of script output to stdout
Here I would have expected a bunch of replaces outputted (replace1, replace2, replace3, ...).
I can't seem to figure out what I am doing wrong. Any help would be greatly appreciated. Thanks in advanced.
I wanted to put "|" this sign at starting and at end of every field but its not working with first field like
Currently the out put is :
abc | abc | abc |
xyz | xyz | xyz |
But I want the out put in this form:
| abc | abc | abc |
| xyz | xyz | xyz |
plz help me. (2 Replies)
hi
i am running script which contains the commmnds and i am redirecting the script output to a file.
like
./script 1> result.txt 2>&1
the above redirection is not working for commands when run in background in a script.
but the problem here result.txt containg output which is repeated.... (3 Replies)
I have a forloop which checks a log for a set of 6 static IP addresses and each IP found is logged to a file which is then mailed to me.
After the forloop I always have a text file that may contain up to 6 IP addresses or may contain 0.
What I want to do is substitute the IP addresses (if any)... (2 Replies)
Hi all
Just wondering if someone can help me with this. I'm trying to write a script that processes the output of another file and prints only the lines I want from it.
This is only the second script I have written so please bare with me here. I have referred to the literature and some of the... (3 Replies)
Below is the my cide which is working fine but I am not getting the output indesired format.there is some problem in alignment.Can someone help me to correct this?
if ];
then
summary=$(
echo -e "Please review the log file of auto coloclean utility.\n";
echo -e... (2 Replies)
currently I have process from a raw file to this stage
ALTER TABLE "EXCEL_ADMIN"."TC_TXN_VOID" ADD CONSTRAINT "PK_TC_TXN_VOID" PRIMARY KEY ("TC_TXN_IID")
ALTER TABLE "EXCEL_ADMIN"."TC_TXN_AMT" ADD CONSTRAINT "PK_TC_TXN_AMT" PRIMARY KEY ("TC_TXN_AMT_IID")
ALTER TABLE... (10 Replies)
Am in need of your help to get the desired output.
nameSECURITY.SERVICES.CONFIG:GETVALUEisPrefetchedNsAccessLast2013-09-13 10:50:13 MESTsAccessTotal1sRunningcHitLastnamePUBLIC.SERVER:INVOKEisPrefetchedNsAccessLast2013-09-17 15:02:05... (5 Replies)
Hi,
I have a text file with some thousands of rows of the following kind (this will be referred to as the inputFileWithColorsAndNumbers.txt):
Blue 6
Red 4
Blue 3
Yellow 4
Red 7
Colors in the left column and a number in the right one for each line. I want to run an awk... (5 Replies)
So I am writing a bash script that will search a file line by line for unix timestamps, store all of the timestamps into an array, then check how many of those timestamps were created within the last hour, and finally increment a counter every time it finds a timestamp created within the last hour.... (6 Replies)