Using sed in a for loop: Note: I recommend to copy few text files and test the result to verify the output.
hi Bipinajith
i get this error message "0403-057 Syntax error at line 3 : `for' is not matched" when i run the script.
i actually copied the few files in a different directory and all worked fine
but when i tried to run it on the main directory then i get that error message
Hi,
I'm having some trouble reading a file that was 'cat' through a while loop. Can anyone suggest alternatives? what i do is
cat filename|grep *.stuff
while read line
do
echo $line
... and other commands
done
The cat,grep line seems to work correctly, but the script hangs when i add in... (3 Replies)
I am writing a script that is running a loop on one file to obtain records from another file.
Using egrep, I am finding matching records in file b, then outputing feilds of both into another file.
****************************
filea=this.txt
fileb=that.txt
cat $filea | while read line
do... (1 Reply)
STEP 1
# Set variable
FILE=/tmp/mainfile
SEARCHFILE =/tmp/searchfile
# THIS IS THE MAIN FILE.
cat /tmp/mainfile
Interface Ethernet0/0 "outside", is up, line protocol is up
Hardware is i82546GB rev03, BW 100 Mbps
Full-Duplex(Full-duplex), 100 Mbps(100 Mbps)
MAC address... (6 Replies)
Hello,
So I sorted my file as I was supposed to:
sort -n -r -k 2 -k 1 file1 | uniq > file2
and when I wrote
> cat file2
in the command line, I got what I was expecting, but in the script itself
...
sort -n -r -k 2 -k 1 averages | uniq > temp
cat file2
It wrote a whole... (21 Replies)
Hi,
I have gps receiver log..its giving readings .like below
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GPSD,R=1
$GPGSV,3,1,11,08,16,328,40,11,36,127,00,28,33,283,39,20,11,165,00*71... (3 Replies)
Hi,
I have two files
one.txt
laptop
boy
apple
two.txt
unix
linux
OS
openS
I want to split one.txt into one line each and concatenate it with the two.txt
output files
onea.txt
laptop (4 Replies)
Hi,
Here is what i'm trying to do,
-Check in two directories for a user inputed filename
-Then cat all the version found of the file to the current screen
I am a total nembie to programming, here what i have done so far....
#!/bin/bash
#Check in /home/loonatic and /var/named/master... (2 Replies)
Hello. I'm making a (hopefully) simple shell script xml parser that outputs a file I can grep for information. I am writing it because I have yet to find a command line utility that can do this. If you know of one, please just stop now and tell me about it. Even better would be one I can input... (10 Replies)
Hi all,
I need to create loop script to read full line and append a variable to each line.
cat file
I need the output like below
10.0.0.1,136 1 24 048800 id N4 No_Light
10.0.0.1,137 1 25 048900 id N4 No_Light
10.0.0.1,140 1 28 048c00 id N4 No_Light
10.0.0.1,262 1 38 048e80... (13 Replies)
Here's my script
echo "1" >>hello.txt
echo "2" >>hello.txt
echo "3" >>hello.txt
mailx -s "Check Status" #myteam@mycomp.com<hello.txt In Outlook I see EMail body as
when I want it to be
can you please suggest ? (29 Replies)
Discussion started by: mohtashims
29 Replies
LEARN ABOUT DEBIAN
net::sieve::script::rule
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)