Sponsored Content
Top Forums Shell Programming and Scripting Help, while loop and sed not producing desired output Post 302483560 by DGPickett on Monday 27th of December 2010 05:01:40 PM
Old 12-27-2010
The while read and sed look OK, but take your < < ( ... ) and hang it on cat -vet to see what the control inputs are.

I am a sed man, so I would have used sed to clean the control up like this (\t s/b a real tab):
Code:
 
sed '
  s/#.*//
  s/[ \t]*$//
  /^$/d
 ' control_file | while read SEARCH REPLACE
 .
 .
 .
 .

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help me in getting the desired output

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)
Discussion started by: akash
2 Replies

2. Shell Programming and Scripting

how to get desired output after redirection

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)
Discussion started by: raji
3 Replies

3. Shell Programming and Scripting

Sed subsitution on loop output in shell script

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)
Discussion started by: Moxy
2 Replies

4. Shell Programming and Scripting

sed in while loop producing arithmetic output

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)
Discussion started by: javathecat
3 Replies

5. Shell Programming and Scripting

SED - output not desired

echo '0x3f 0xfa ae 0xeA' | sed '/0x/ y/abcdef/ABCDEF/' output: 0x3F 0xFA AE 0xEA echo '0x3f 0xfa ae 0xeA' | sed -r '/0x{2}/ y/abcdefg/ABCDEFG/' output: 0x3F 0xFA AE 0xEA my expected output: 0x3F 0xFA ae 0xEA What I want to achieve is change all hexadecimals to UPPER case(only those... (6 Replies)
Discussion started by: kevintse
6 Replies

6. Shell Programming and Scripting

need to get the desired output

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)
Discussion started by: anuragpgtgerman
2 Replies

7. Shell Programming and Scripting

How to grep the desired output and output to a file?

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)
Discussion started by: jediwannabe
10 Replies

8. Shell Programming and Scripting

Help!! needed to get the desired output

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)
Discussion started by: rocky2013
5 Replies

9. Shell Programming and Scripting

awk script not producing output

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)
Discussion started by: Zooma
5 Replies

10. Shell Programming and Scripting

Printing the output of sed using a loop

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)
Discussion started by: jsikarin
6 Replies
Net::Sieve::Script::Rule(3pm)				User Contributed Perl Documentation			     Net::Sieve::Script::Rule(3pm)

NAME
Net::Sieve::Script::Rule - parse and write rules in sieve scripts SYNOPSIS
use Net::Sieve::Script::Rule; my $pRule = Net::Sieve::Script::Rule->new ( ctrl => $ctrl, test_list => $test_list, block => $block, order => $order ); or my $rule = Net::Sieve::Script::Rule->new(); my $cond = Net::Sieve::Script::Condition->new('header'); $cond->match_type(':contains'); $cond->header_list('"Subject"'); $cond->key_list('"Re: Test2"'); my $actions = 'fileinto "INBOX.test"; stop;'; $rule->add_condition($cond); $rule->add_action($actions); print $rule->write; DESCRIPTION
CONSTRUCTOR
new Arguments : order => : optionnal set priority for rule ctrl => : optionnal default 'if', else could be 'else', 'elsif' or 'vacation' test_list => : optionnal conditions by string or by Condition Object block => : optionnal block of commands Returns : Net::Sieve::Script::Rule object Set accessors alternate : as param ctrl conditions : first condition in tree actions : array of actions objects priority : rule order in script, main id for rule require : METHODS
equals return 1 if rules are equals write Return rule in text format write_condition set require for used conditions return conditions in text format write_action set require for used actions return actions in text format delete_condition Purpose : delete condition by rule, delete all block on delete anyof/allof delete single anyof/allof block : single condition move up Arguments : condition id Returns : 1 on success, 0 on error add_condition Purpose : add condition to rule, add 'allof' group on second rule Arguments : string or Condition object Returns : new condition id or 0 on error swap_actions swap actions by order return 1 on succes, 0 on failure find_action find action by order Returns: Net::Sieve::Script::Action object, 0 on error delete_action delete action by order, first is 1; add_action Purpose : add action at end of block Arguments : command line or command line list with ; separator or Net::Sieve::Script::Action object Return : 1 on success AUTHOR
Yves Agostini CPAN ID: YVESAGO Univ Metz agostini@univ-metz.fr http://www.crium.univ-metz.fr COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.10.0 2008-09-15 Net::Sieve::Script::Rule(3pm)
All times are GMT -4. The time now is 02:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy