Hi, Sorry for the dumb question but I can't seem to figure this one out. I want to write an if condition that basically checks if my variable is in a file. So far I have the following:
if ]
then
do something
else
do something else
fi
So essentially if the grep returns something then... (3 Replies)
How can I use a variable that has the conditions for the if statement stored in it?
my test script
condition=" || || "
if "$condition"
then echo "true"
else echo "false"
fi
output
$ ./test2.sh
./test2.sh: line 3: || || : command not found
false (2 Replies)
Hi friends,
I'm having a bit of a problem using shell variable in an awk if statement.
Please note that i'm using -v option as listed in many forums but I still don't get it working. Here's my code. Kindly help as I've gone crazy trying to work this out :wall:
#!/bin/bash -xv
... (4 Replies)
Please help me with this:
I need to compare two values in if condition in shell script but its goes always to else condition:
TIME_CHECK=PM
TIME-CLOCK=PM
if ; then
echo "You have access!"
else
echo "ACCESS DENIED!"
fi (5 Replies)
if
then
echo "Entry Valid : ${x_oug}"
else
echo "Entry Invalid : " 0
fi
In the above code the 3rd line is not working... it does not print anything
I tried following as well .. but no luck!
echo "Entry Valid : ... (13 Replies)
In AIX, why is it variable VAR becomes true in the condition despite VAR was unassigned and not equal to 1?
In Linux, it was traced as an error as VAR is not declared as variable and expecting an integer as argument.
one.sh
VAR=1
if ; then
echo "One"
fi
if ; then
echo "Two"... (5 Replies)
i have this code
for i in `cat sql_output.txt`
do
-- some script commands
done
sql_output.txt has 1 column with employee_ids
If the sql_output.txt is null then the do loop should not execute.
How can i implement this.
for i in `cat sql_output.txt`
If i is null or empty
then ... (5 Replies)
Guys,
Please help me on the below
sample.cfg
var=NULL
sample.sh
#!/bin/sh
. /sample.cfg
if ;then
1 st command here
else
2 nd command here
fi (3 Replies)
Hi,
I'm trying to automate part of a script which uses awk to grab out some lines of a log file based on certain fields matching. For example, my log file looks something like the following (but 1000s of lines):
1 Tom 123 abc 345
2 Dick 345 abc 678
3 Harry 567 abc 345
4 Tom 345 cde 345... (3 Replies)
Hi Gurus,
I have a command to assign value based on input value.
current condition is "if pattern matches "case", then assign "HOLD" else "SUCC"right now, I need to add one more condition (variable name is VAR).
the condition is "if pattern1 matches "case", then assign "HOLD" else if... (2 Replies)
Discussion started by: ken6503
2 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)