Sponsored Content
Top Forums Shell Programming and Scripting Confirming Syntax - IF statement. Post 302178633 by Klashxx on Wednesday 26th of March 2008 04:19:53 AM
Old 03-26-2008
This way is clearer for me:
Code:
if [ "${MKT}"="PU" -o "${MKT}"="PH" ] && [ "${FILETYPE}"="PAY" ]
then
     cp ${FTP_DIR}/${MKT}-${DOR}.BANKHOLIDAY \
     ${FTP_ARC}/${MKT}-${DOR}-${FILETYPE}.BANKHOLIDAY
else
  mv ${FTP_DIR}/${MKT}-${DOR}.BANKHOLIDAY \
     ${FTP_ARC}/${MKT}-${DOR}-${FILETYPE}.BANKHOLIDAY
fi

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

syntax error on if statement

Hi, Can you please help me with this one: I write an "if" statement, something like this: if then echo "big file" else echo "normal file" and I get an error: `'then is not expected Thanks in advance (6 Replies)
Discussion started by: apenkov
6 Replies

2. UNIX for Dummies Questions & Answers

if statement code syntax

Hi, can someone please tell me what is wrong with this code? I just want it to check if the file size is greater than 2000kb. if Thanks! ---------- Post updated at 09:23 PM ---------- Previous update was at 09:21 PM ---------- I should probably post the full code: #!/bin/sh... (9 Replies)
Discussion started by: Bengel
9 Replies

3. Shell Programming and Scripting

Syntax error in script with if statement

I'm working on a function in a shell script I'm writing that will eventually take in and print out a list of vendor names and aliases (for my work) Here's the function in question: addvendorandalias () { echo echo -n 'Would you like to create a new vendor list (y or n)? ' read answer... (3 Replies)
Discussion started by: Straitsfan
3 Replies

4. AIX

Confirming command

Guy's I'm trying to create script to execute some critical commands in AIX like the below ... stopsrc -s qdaemon stopsrc -s sshd stopsrc -s lpd stopsrc -s nfsd I want between each command to ask me like this " are you sure to stop qdaemon " " are you sure to stop ssh" " are... (3 Replies)
Discussion started by: Mr.AIX
3 Replies

5. Shell Programming and Scripting

complex if statement syntax without using 'if ..' keyword in ksh.

It saves me lot of typing and space/lines when I do not use full 'if' keyword and construct, instead use .. && <statement> || <statement> that perfectly replaces.. if ; then <statement> else <statement> fi Can I use following syntax when I want to add multiple statements under 'if'... (4 Replies)
Discussion started by: kchinnam
4 Replies

6. Shell Programming and Scripting

Help with if statement syntax

Hi, Is there a way to compare the value in if condition with a list of values. eg . if ] then echo "it's a mammal" else echo "its not" fi Thanks! (8 Replies)
Discussion started by: neil.k
8 Replies

7. Shell Programming and Scripting

If statement Syntax error

Hi Can you please tell me what is wrong with this line: if && ]; then basically i want to check if x = 12 and F (Filename) end with 'g'. But it is throwing syntax error. (7 Replies)
Discussion started by: rtagarra
7 Replies

8. Shell Programming and Scripting

[Solved] 0403-057 Syntax error for if statement

I am getting the following error when I am running a script in ksh when trying to execute an if statement comparing two numerical values tstmb.sh: 1.5321e+08: 0403-057 Syntax error Below is my code snippet. #!/bin/ksh set -x TODAY=$(date +%y%m%d) for file in $(ls -rt *.log | tail... (11 Replies)
Discussion started by: kiran1112
11 Replies

9. Shell Programming and Scripting

Help with if statement syntax in shell script

I want to make the file test condition a variable ($Prmshn in code below). My goal is to use something like the first three unsuccessful if statetments since the 'if #!/bin/ksh test_input() { Prmshn=${1} InFLNm=${2} ifReq="-$Prmshn $InFLNm" #the following three if statments fail: #if ] ;... (10 Replies)
Discussion started by: ms63707
10 Replies

10. UNIX for Beginners Questions & Answers

Syntax for if statement

I'm new to unix and the command line and am trying to learn different commands. I have a file (teledir.txt) that contains a name and phone number for 3 different people. I am writing a script that is to take two positional parameters and I typed out how it should behave: if <name and number... (1 Reply)
Discussion started by: Eric7giants
1 Replies
FAXRCVD(8C)															       FAXRCVD(8C)

NAME
faxrcvd - HylaFAX notification script for received facsimile SYNOPSIS
/var/spool/fax/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 bin/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/fax spooling area /usr/sbin/faxinfo for printing information about the facsimile /usr/bin/fax2ps for converting TIFF to PostScript /usr/sbin/sendmail for delivering mail /var/spool/fax/etc/templates/ base directory for outgoing e-mail templates SEE ALSO
faxd(8C), hylafax-server(5F), recvq(5F) May 28, 2001 FAXRCVD(8C)
All times are GMT -4. The time now is 10:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy