Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Variable not displaying in subject line of mailx email Post 303037408 by ltzwoman on Wednesday 31st of July 2019 05:29:43 PM
Old 07-31-2019
Variable not displaying in subject line of mailx email

Hi

Newbie here with first post. I've got a shell script (ksh) whereby I run a SQL*Plus script and output the results to a file. I then check the output file in an if statement that looks like this:

Code:
if [[ -e $OUTFILE ]]; then

export GAPNUM=`awk '{print $4}' $OUTFILE`

  if [[ $GAPNUM -ge 5 ]] then

  mailx -s "Possible Redo Apply Issue at $ORACLE_SID - Log Gap is "$GAPNUM" $MAIL_TO < $OUTFILE

  mv $OUTFILE $OUTFILE.$DAYHOUR

  fi

else

    echo "$OUTFILE does not exist" | mailx -s $SUBJECT $MAIL_TO
fi

Everything works fine except when the email is sent, although $ORACLE_SID value displays, $GAPNUM does not. I've searched on this site and others and am not sure what I'm doing wrong. If I place an echo $GAPNUM just before the mailx line it displays. What am I missing?

Thanks,

Laura

Last edited by Corona688; 07-31-2019 at 06:57 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

use email subject line as shell command

If anyone can give me some ideas on this it would be great. What I'm trying to do is to have emails be sent to my unix account. Once they are emailed to the unix account, I want to use the text in the subject field to invoke a shell script, so basically I need to find a way that I can... (4 Replies)
Discussion started by: mskarica
4 Replies

2. UNIX for Advanced & Expert Users

Unable to send eMail from a UNIX-Host ( using mailx ) to a Outlook-email-addres(Win)

Hi A) I am able to send eMail using mailx from a UNIX ( solaris 8 ) host to my Outlook-email-ID : FName.Surname@Citigroup.com ( This is NOT my actual -eMail-ID). But in Outlook the "From :" eMail address is displayed as " usr1@unix-host1.unregistered.email.citicorp.com " .i.e the words... (2 Replies)
Discussion started by: Vetrivela
2 Replies

3. Shell Programming and Scripting

Email with subject contains value of Variable

I want to email where subject contains value of variable $ORACLE_SID. When script is emailing, it is not taking value of $ORACLE_SID. example - I have variable ORACLE_SID=prd I am sending email with below script. tail -1 $LOG | mailx -s 'Export Completed for ${ORACLE_SID}'... (2 Replies)
Discussion started by: deepsingh
2 Replies

4. Shell Programming and Scripting

Run a script based on the subject line of the email

Hi, I need help in running a script that would pull info from an email subject line and run a script (foo.sh). I'm pretty sure after a bit of googling that this is possible in several ways. but none was pretty clear on how to accomplish it. The part that I really need help with is getting the... (5 Replies)
Discussion started by: satekn
5 Replies

5. Shell Programming and Scripting

executing/including command in mailx subject line

Hi, Is it possible for me to include the results from a command in the subject line? What I am looking to do is get the file count and include it into the subject line as well as the list of files in the body. Example Subject line: Currently 25 files in directory My Code: #!/bin/ksh cd... (2 Replies)
Discussion started by: ozifer
2 Replies

6. Shell Programming and Scripting

help with script to send email and if subject line match is found

Help with script that will check log, then find a match is found, add that as the subject line. 1. The script will always run as a deamon.. and scan the event.log file 2. when a new 101 line is added to the event.log file, have the script check position 5,6 and 7 which is the job name, which... (2 Replies)
Discussion started by: axdelg
2 Replies

7. Shell Programming and Scripting

Subject line of an email

Hi all, I am trying to automate a process in which at the end of the process the script should send an email to the user saying this process is completed. I have done everything but the problem now is the subject line of the email... the subject line looks like this.. where abc xyz is a... (4 Replies)
Discussion started by: smarty86
4 Replies

8. Shell Programming and Scripting

Content of attachment is displaying along with subject in mailx

Hi All, I want to send the csv to an email address. I have tried the below two approaches. Approach1: Got error -ksh: uuencode: not found $ uuencode test_file.csv test_file.csv | mailx -s "Attaching test" msdc.kiran@gmail.com </usr/home/test_file.csv -ksh: uuencode: not found Approach2:... (6 Replies)
Discussion started by: ROCK_PLSQL
6 Replies

9. Shell Programming and Scripting

Sendemail how to send an email with a subject variable

Hi,:) I try this : #!/bin/bash sender="me@example.com" recipient="you@example.com" subject="TEST FILE" server="0.0.0.0" file=$(cat file.txt) /usr/bin/sendemail -f $sender -t $recipient -u $subject -m $file My file.txt: BLABLALA BLABLABLA (7 Replies)
Discussion started by: Arnaudh78
7 Replies

10. Shell Programming and Scripting

Sending sql output to email body with conditional subject line

hi , i have written below piece of code to meet the requirement but i am stuck in the logic here. the requirement are: 1) to send the sql out put to email body with proper formatting. 2) if count_matching = Yes then mail should triggered with the subject line ... (10 Replies)
Discussion started by: itzkashi
10 Replies
gasp(1) 						       GNU Development Tools							   gasp(1)

NAME
gasp - a preprocessor for assembly programs SYNOPSIS
gasp [-a|--alternate] [-c CHAR | --commentchar CHAR] [-d|--debug] [-h|--help] [-M|--mri] [-o OUTFILE | --output OUTFILE] [-p|--print] [-s|--copysource] [-u|--unreasonable] [-v|--version] INFILE ... DESCRIPTION
The primary purpose of the GNU assembler is to assemble the output of other programs--notably compilers. When you have to hand-code spe- cialized routines in assembly, that means the GNU assembler is an unfriendly processor: it has no directives for macros, conditionals, or many other conveniences that you might expect. In some cases you can simply use the C preprocessor, or a generalized preprocessor like M4; but this can be awkward, since none of these things are designed with assembly in mind. gasp fills this need. It is expressly designed to provide the facilities you need with hand-coded assembly code. Implementing it as a preprocessor, rather than part of the assembler, allows the maximum flexibility: you can use it with hand-coded assembly, without paying a penalty of added complexity in the assembler you use for compiler output. INFILE... are the files to be preprocessed. OPTIONS
The simplest way to use GASP is to run it as a filter and assemble its output. In Unix and its ilk, you can do this, for example: $ gasp prog.asm | as -o prog.o Naturally, there are also a few command-line options to allow you to request variations on this basic theme. Here is the full set of pos- sibilities for the GASP command line. -a --alternate Use alternative macro syntax. *Note Alternate macro syntax: Alternate, for a discussion of how this syntax differs from the default GASP syntax. -c CHAR --commentchar CHAR Use CHAR as the comment character. The default comment character is `!'. For example, to use a semicolon as the comment character, specify `-c ';'' on the GASP command line. Since assembler command characters often have special significance to command shells, it is a good idea to quote or escape CHAR when you specify a comment character. For the sake of simplicity, all examples in this manual use the default comment character `!'. -d --debug Show debugging statistics. In this version of GASP, this option produces statistics about the string buffers that GASP allocates internally. For each defined buffersize S, GASP shows the number of strings N that it allocated, with a line like this: strings size S : N GASP displays these statistics on the standard error stream, when done preprocessing. -h --help Display a summary of the GASP command line options. -M --mri Use MRI compatibility mode. Using this option causes GASP to accept the syntax and pseudo-ops used by the Microtec Research `ASM68K' assembler. -o OUTFILE --output OUTFILE `-o OUTFILE' `--output OUTFILE' Write the output in a file called OUTFILE. If you do not use the `-o' option, GASP writes its out- put on the standard output stream. -p --print Print line numbers. GASP obeys this option _only_ if you also specify `-s' to copy source lines to its output. With `-s -p', GASP displays the line number of each source line copied (immediately after the comment character at the beginning of the line). -s --copysource Copy the source lines to the output file. Use this option to see the effect of each preprocessor line on the GASP output. GASP places a comment character (`!' by default) at the beginning of each source line it copies, so that you can use this option and still assemble the result. -u --unreasonable Bypass "unreasonable expansion" limit. Since you can define GASP macros inside other macro definitions, the preprocessor normally includes a sanity check. If your program requires more than 1,000 nested expansions, GASP normally exits with an error message. Use this option to turn off this check, allowing unlimited nested expansions. -v --version Display the GASP version number. INFILE ... The input file names. You must specify at least one input file; if you specify more, GASP preprocesses them all, concatenating the output in the order you list the INFILE arguments. Mark the end of each input file with the preprocessor command `.END'. SEE ALSO
`gasp' entry in info; The GNU Binary Utilities, Roland H. Pesch (October 1991); gasp(1). Debian September 1999 gasp(1)
All times are GMT -4. The time now is 07:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy