Sponsored Content
Top Forums Shell Programming and Scripting Multipe conditions in if statement Post 302348519 by denn on Friday 28th of August 2009 01:23:13 PM
Old 08-28-2009
Code:
#!/usr/bin/bash

MINUTE=`date '+%M'`
HOUR=`date '+%H'`

case $MINUTE in
        28 )
                case $HOUR in
                     0[6-9] )
                         # insert send email statement(s) here
                          ;;
                     [1-2]* )
                         # insert send email statement(s) here
                          ;;
                esac
esac

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

if statement with two conditions

Hi, I am trying to use && set up to match two conditions within ksh: if && then '''Do something if somehow, I keep getting error message telling me that ] is missing. What's wrong with my code? Thanks a lot for your help! (1 Reply)
Discussion started by: cin2000
1 Replies

2. Shell Programming and Scripting

How to giv two conditions in IF statement..??

Actually i need to satisfy both the condition.. lik i'm lookin for two different files.. and if BOTH the files r not present then it should run the followin script.. For example inputfile1=data/in/inputfile1.txt inputfile2=data/in/inputfile2.txt if then echo " " echo... (6 Replies)
Discussion started by: RRVARMA
6 Replies

3. UNIX for Dummies Questions & Answers

Two conditions in one if statement

I'm totally new with bash programming and I don't get it how to put two conditions in one if statement. My code looks like this: h=`date +%k` if && ]; then$h is 10 but I don't get into my if statement. What's wrong here? (5 Replies)
Discussion started by: borobudur
5 Replies

4. Shell Programming and Scripting

If statement with multiple conditions

I have a script that runs on multiple servers. What I want to do is have the script do the following: if $(hostname) is equal to server or server2 then TO_DIR=go else TO_DIR=stop fi I have tried: if if ] Server is hpux. any ideas? (1 Reply)
Discussion started by: cpolikowsky
1 Replies

5. Shell Programming and Scripting

Multiple conditions in a CASE statement

is it possible to use multiple conditions in a CASE statement? And if so, what is the syntax? I'm trying to use one but can't seem to get it right. I want the statement to be CASE $vendor OR $alias condition 1) statements; condition 2) statements; etc. esac but I keep... (25 Replies)
Discussion started by: Straitsfan
25 Replies

6. Shell Programming and Scripting

Multiple Conditions Perl if Statement

Hello, I'm trying to put together a script that involves pulling data from a config file. I'm attempting to write an if statement to validate one of the pieces of data from the config file, but I think I'm fat fingering it somehow. $config{VALUE} is being pulled from a config file but can only... (4 Replies)
Discussion started by: Picch
4 Replies

7. Shell Programming and Scripting

How to Evaluate two conditions in single if statement

I am trying to test two conditions in a single if and getting syntax error on -a and && if ] ; then echo "variable a equals to variable b" else echo "variable a not equal to variable b" fi in second attempt I used -a instead of &&, referring to other website, but not sure that... (1 Reply)
Discussion started by: praxis1
1 Replies

8. Shell Programming and Scripting

Multiple conditions inside my if statement

Hello, I am using shell scripting and I am recieving odd results from my if statement if I want it to enter the loop only if L1 is equal to zero and one of the other criteria are filled, however it is entering at other times as well. What can i do to fix this? i tried seperating it... (6 Replies)
Discussion started by: ryddner
6 Replies

9. UNIX for Dummies Questions & Answers

If statement with two boolean conditions

#!/bin/bash if && then echo "True" else echo "False" fi Hi everyone, I am new to UNIX, here I have a if statement elevating two boolean conditions. I thought the output should be True because there are + in the statement. But it turns out to be False. Can anyone... (3 Replies)
Discussion started by: mryuyu1111
3 Replies

10. Shell Programming and Scripting

How to Check Multiple conditions in IF statement?

I wish to check two conditions inside the if statement Condition 1: The two file contents should be identical // using cmp command for this. Condition 2: The two filenames should NOT be the same. This is what i did in vain. if ]; then where entry1 and entry2 are ls *.txt | while... (7 Replies)
Discussion started by: mohtashims
7 Replies
FAXRCVD(8)						      System Manager's Manual							FAXRCVD(8)

NAME
faxrcvd - HylaFAX notification script for received facsimile SYNOPSIS
/var/spool/hylafax/bin/faxrcvd qfile devid commid error-msg [ callid-1 [ callid-2 [ ... [ callid-n ] ] ] ] DESCRIPTION
bin/faxrcvd is the command script invoked by the facsimile server whenever a facsimile is received. The default script sends electronic mail to the FaxMaster user describing the content of the facsimile and other useful information such as the time spent receiving the docu- ment. The arguments are: qfile the pathname of the received TIFF file relative to the root of the spooling hierarchy. devid the modem device on which the facsimile was received. commid the communication identifier for the inbound call. error-msg an error message that is non-null if an error was encountered during the receive operation. callid the value of various identification indicators from the call NOTES
This script can route facsimile directly to the intended recipient. To do this create a shell script etc/FaxDispatch in the spooling area that sets SENDTO to the receiver's electronic mail address. For example, case "$SENDER" in *1*510*526*1212*) SENDTO=sam;; # Sam's test rig in Berkeley *1*415*390*1212*) SENDTO=raster@asd;; # 7L Xerox room, used for scanning *5107811212) SENDTO=peebles@mti;; # stuff from home esac case "$DEVICE" in ttyS1) SENDTO=john;; # all faxes received on ttyS1 ttyLT0) SENDTO=mary@home;; # all faxes received on ttyLT0 esac case "$CIDNUMBER" in 435*) SENDTO=lee; FILETYPE=pdf;; # all faxes from area code 435 5059627777) SENDTO=amy; FILETYPE=tif;; # Amy wants faxes in TIFF esac case "$SUBADDR" in 53) SENDTO=FaxMaster;; # without double-notification roger) SENDTO=roger;; # possible text subaddressing esac Note that you must match any embedded white space. The facsimile will be sent as a MIME-encoded PostScript document as default. CALLIDn is equivalent to the nth call identification parameter CIDNAME is equivalent to CALLID2 above. CIDNUMBER is equivalent to CALLID1 above. DEVICE is equivalent to device above. FILETYPE controls the filetype of the image attachment. Current filetype options are ``ps'', ``tif'', and ``pdf''. Multiple values may be specified by separating them with whitespace. In that case a separate attachment is created for each filetype. FROMADDR controls the sender of the received fax notification. It is given as an e-mail address. MSG is equivalent to error-msg above. NOTIFY_FAXMASTER (an underscore ``_'' character is between NOTIFY and FAXMASTER) indicates whether or not the HylaFAX administrator should be noti- fied regarding incoming facsimile. Default is ``always''. Also available are ``never'', which means to never send any received facsimile notification, and ``errors'', which means to send notification only if there were reception errors. SENDER is the received TSI of the fax sender. SENDTO controls the recipient of the received fax notification. It is given as an e-mail address, and it's value will be passed directly to the MTA for delivery as well as being inserted into the email. If you want to send to multiple receipients in seperate messages set the variable SENDTO1...SENDTOn in addition to SENDTO. faxrcvd will process additional SENDTOn variables starting at 1, and stopping at the first empty SENDTOn variable it finds. The templates should continue to reference $SENDTO, and faxrcvd will make sure it get's set correctly as the template is processed for each one. SUBADDR the received subaddress value, communicated by the sender for post-reception routing purposes TEMPLATE the template subdirectory to use when sending e-mails. HylaFAX ships with a base set of templates, and some direct translations. To use the German translated templates, set TEMPLATE=de in FaxDispatch. This is relative to the base template directory. Other shell variables are available. Consult the faxrcvd script directly. FILES
/var/spool/hylafax spooling area /usr/sbin/faxinfo for printing information about the facsimile /usr/bin/fax2ps for converting TIFF to PostScript /usr/lib/sendmail for delivering mail /var/spool/hylafax/etc/templates/ base directory for outgoing e-mail templates SEE ALSO
faxd(8), hylafax-server(5), recvq(5) May 28, 2001 FAXRCVD(8)
All times are GMT -4. The time now is 08:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy