Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Turn off exec 2>${_ERRORFILE} > ${_LOGFILE} feature? Post 302992990 by SIMMS7400 on Saturday 4th of March 2017 01:24:11 PM
Old 03-04-2017
Hi Folks -

Thanks for all your help!!

This is what did thw trick for me, thanks to drysdalk!

Code:
source /app/hyp_app/scripts/setenv.sh

#::-- Set Script Name --::#
_SN=${0##*/}

echo Script Name: ${_SN}
#::-- Script Name w/o EXT: ${_SN%%.sh*} --::#

#::-- Set Log & Error Files --::#
_INTRA_PATH=${_FDMEE_LOG_DIR}
_ERROR_INTRA_PATH=${_FDMEE_ERROR_DIR}

_LOGFILE=${_INTRA_PATH}/${_DATETIMESTAMP}_${_SN%%.sh*}.log
_ERRORFILE=${_ERROR_INTRA_PATH}/${_DATETIMESTAMP}_${_SN%%.sh*}.err

#::-- Direct STDOUT and STDERROR to repositories --::# 
#exec 2>${_ERRORFILE} > ${_LOGFILE}

exec 3>&1 4>&2 1>${_LOGFILE} 2>${_ERRORFILE}

#::-- Begin Script Processing --::#
echo ------------------------------------------
echo ${_SN} Starting at ${_TIME}                      
echo ------------------------------------------
echo ------------------------------------------
echo Execute FDMEE Actuals Load           
echo ------------------------------------------
 
. ${_FDMEE_UTIL_DIR}/runbatch.sh $APPID -f:${_FDMEE_APP_PSWRD} ${_FDMEE_BATCH}

if [ $? -eq 0 ]
then
    echo ------------------------------------------
    echo ${_SN%%.sh*} - Completed Successfully           
    echo ------------------------------------------
    echo ------------------------------------------
    echo Script Process Exiting Normally          
    echo ------------------------------------------
    exec 1>&3 2>&4
    cat ${_LOGFILE}
  exit 0
else
    echo ------------------------------------------
    echo ${_SN%%.sh*} - Completed Unsuccessfully           
    echo ------------------------------------------
    echo ------------------------------------------
    echo Script Process Exiting Abnormally          
    echo ------------------------------------------
  exit 1
fi

Thanks again!
 

6 More Discussions You Might Find Interesting

1. SCO

BASH-like feature. is possible ?

Greetings... i was wondering if there is any shell configuration or third party application that enables the command history by pressing keyboard up arrow, like GNU/BASH does or are there an SCO compatible bash versio to download? where ? just wondering (sory my stinky english) (2 Replies)
Discussion started by: nEuRoMaNcEr
2 Replies

2. UNIX for Dummies Questions & Answers

How to turn off duplex

I am using digital Unix and lpd. I have HP 4200n LaserJet TCP printer, but when I use lpr command, it always print duplex. I can turn off duplex feature at the panel of the printer, but then other Windows computer cannot print duplex. How can I set up /etc/printcap file so that it will be... (2 Replies)
Discussion started by: hiepng
2 Replies

3. UNIX for Dummies Questions & Answers

turn off sound

how to disable anoying beep sound??? (4 Replies)
Discussion started by: nnn
4 Replies

4. Shell Programming and Scripting

Script Variables Inquiry, Values Okay in Standalone Exec, No-Show in Cron Exec

I have the following bash script lines in a file named test.sh. #!/bin/bash # # Write Date to cron.log # echo "Begin SSI Load $(date +%d%b%y_%T)" # # Get the latest rates file for processing. # d=$(ls -tr /rms/data/ssi | grep -v "processed" | tail -n 1) filename=$d export filename... (3 Replies)
Discussion started by: ginowms
3 Replies

5. UNIX for Beginners Questions & Answers

Exec command with mutt - turn on & off?

Hi Folks - Quick question around the exec command again. At the end of my script, I check for specific error codes that are returned from a process I execute within the shell script. Based on the error code, I send an email. Do I need to turn off exec feature prior to send each email so... (5 Replies)
Discussion started by: SIMMS7400
5 Replies

6. UNIX for Beginners Questions & Answers

Just can't turn off ipv6?

I'm running a Linux OS that uses Debian as it's base. A commercial vpn is installed that uses OpenVPN. For some reason, I can't get ipv6 to tunnel properly .... and Ipleak.net shows that my location is being unmasked by ipv6. I've tried kernel commands at boot, I've tried sysctl.conf commands.... (2 Replies)
Discussion started by: benc
2 Replies
echo(3XCURSES)						  X/Open Curses Library Functions					    echo(3XCURSES)

NAME
echo, noecho - enable/disable terminal echo SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib -R /usr/xpg4/lib -lcurses [ library... ] c89 [ flag... ] file... -lcurses [ library... ] #include <curses.h> int echo(void); int noecho(void); DESCRIPTION
The echo() function enables Echo mode for the current screen. The noecho() function disables Echo mode for the current screen. Initially, curses software echo mode is enabled and hardware echo mode of the tty driver is disabled. The echo() and noecho() functions control soft- ware echo only. Hardware echo must remain disabled for the duration of the application, else the behavior is undefined. RETURN VALUES
Upon successful completion, these functions return OK. Otherwise, they return ERR. ERRORS
No errors are defined. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
getch(3XCURSES), getstr(3XCURSES), initscr(3XCURSES), libcurses(3XCURSES), scanw(3XCURSES), attributes(5), standards(5) SunOS 5.10 5 Jun 2002 echo(3XCURSES)
All times are GMT -4. The time now is 02:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy