Sponsored Content
Top Forums Shell Programming and Scripting Send an email if "No such file or directory" in the shell script program log in EBS concur Post 303035330 by Mist123 on Tuesday 21st of May 2019 08:44:05 AM
Old 05-21-2019
Send an email if "No such file or directory" in the shell script program log in EBS concur

Hi All,

I have the below code(.sh) and need to send an email.
Code:
#!/bin/bash
cp /u02/xxc_incoming/TEST*.dat /u02/xxc_archive_incoming/AMER7764_ARPP_2/
cat /u02/xxc_incoming/TEST*.dat > /u02/xxc_incoming/XXC_TEST.dat
rm /u02/xxc_incoming/TEST*.dat
cd $XXC_TOP/bin
sqlldr userid=apps/<pwd>  control=/u02/xxc/1.0/bin/XXC_INSERT.ctl rows=1
cat /u02/xxc_incoming/XXC_TEST.dat >> /u02/xxc_archive_incoming/AMER7764_ARPP_2/XXC_TEST.txt

Program log is showing below messages , if this one or some thing error occurs so then send an email.
cp: cannot stat ‘/u02/xxc_incoming/TEST*.dat': No such file or directory
cat: /u02/xxc_incoming/TEST*.dat: No such file or directory
rm: cannot remove ‘/u02/xxc_incoming/TEST*.dat': No such file or directory

could you please help me?

Thank you
 

9 More Discussions You Might Find Interesting

1. AIX

"too big" and "not enough memory" errors in shell script

Hi, This is odd, however here goes. There are several shell scripts that run in our production environment AIX 595 LPAR m/c, which has sufficient memory 14GB (physical memory) and horsepower 5CPUs. However from time to time we get the following errors in these shell scripts. The time when these... (11 Replies)
Discussion started by: jerardfjay
11 Replies

2. Shell Programming and Scripting

Shell script: If a file stays in a particular directory more than 30 min send an email

Hi , I am new to shell scripting. i have a requirement say i will receive a file in a directory say /xyz.if that file stays in that directory more than 30 min i need to get a mail to my outlook.this should run for every 20 min in crontab. can anyone help me? (8 Replies)
Discussion started by: muraliinfy04
8 Replies

3. UNIX for Advanced & Expert Users

how to send email using "mail" to google or yahoo

hi all, i need to email the output of a command to a google or yahoo account. am using debian lenny 5. can someone please help me on this ? (5 Replies)
Discussion started by: coolatt
5 Replies

4. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

5. UNIX for Dummies Questions & Answers

script works well but displays " line 6: =: No such file or directory"

strange :) can you tell why?:cool: #!/bin/bash echo " enter your age " read age if ; then echo " you do not have to pay tax " elif ]; then echo " you are eligible for income tax " else echo " you dont have to pay tax " fi (3 Replies)
Discussion started by: me.
3 Replies

6. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

7. Shell Programming and Scripting

Expect: spawn id exp5 not open while executing "expect "$" { send "sudo su -\r" }"

Hi All, i am trying to ssh to a remote machine and execute certain command to remote machine through script. i am able to ssh but after its getting hung at the promt and after pressing ctrl +d i am gettin the out put as expect: spawn id exp5 not open while executing "expect "$" {... (3 Replies)
Discussion started by: Siddharth shivh
3 Replies

8. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

9. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
SDPA(1) 						      General Commands Manual							   SDPA(1)

NAME
SDPA - High-performance software package for SemiDefinite Programs SYNOPSIS
sdpa DataFile OutputFile [InitialPtFile] [-pt parameters] [-dimacs] [-numThreads numThreads] sdpa [options] files... sdpa --version DESCRIPTION
sdpa - "SDPA (SemiDefinite Programming Algorithm)" is one of the most efficient and stable software packages for solving SDPs based on the primal-dual interior-point method. SDP (SemiDefinite Program) is used for financial engineering, machine learning, control theory, sensor network problem, quantum chemistry, quantum information, combinatorial optimizaiton, polynomial optimization, and so on. Futher information on SDP and SDPA can be found at http://sdpa.sourceforge.net/ OPTIONS
---- option type 1 ---- sdpa DataFile OutputFile [InitialPtFile] [-pt parameters] [-dimacs] [-numThreads numThreads] parameters = 0 default, 1 fast (unstable), 2 slow (stable) example1-1: sdpa example1.dat example1.result example1-2: sdpa example1.dat-s example1.result example1-3: sdpa example1.dat example1.result example1.ini example1-4: sdpa example1.dat example1.result -pt 2 example1-5: sdpa example1.dat example1.result -dimacs example1-6: sdpa example1.dat example1.result -numThreads 4 ---- option type 2 ---- sdpa [option filename]+ -dd : data dense :: -ds : data sparse -id : init dense :: -is : init sparse -o : output :: -p : parameter -pt : parameters , 0 default, 1 fast (unstable) 2 slow (stable) example2-1: sdpa -o example1.result -dd example1.dat example2-2: sdpa -ds example1.dat-s -o example1.result -p param.sdpa example2-3: sdpa -ds example1.dat-s -o example1.result -pt 2 example2-4: sdpa -ds example1.dat-s -o example1.result -dimacs example2-5: sdpa -ds example1.dat-s -o example1.result -numThreads 4 ---- option type 3 ---- sdpa --version to print out version and exit. PARAMETER_FILE is decided by the following priority 1: The file assigned by '-p' option of 'option type 2'. For 'option type1', this is skipped. 2: ./param.sdpa For 'option type2', this is skipped. 3: /usr/share/sdpa/param.sdpa 4: Default parameter -dimacs printout dimacs information incurring additional computation cost -numThreads number of pthreads for internal computation AUTHOR
SDPA was written by SDPA Project <sdpa-developers@lists.sourceforge.net>. This manual page was written by Makoto Yamashita <Makoto.Yamashita@is.titech.ac.jp>. July 28, 2011 SDPA(1)
All times are GMT -4. The time now is 01:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy