Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Turn off exec 2>${_ERRORFILE} > ${_LOGFILE} feature? Post 302992974 by SIMMS7400 on Saturday 4th of March 2017 08:00:15 AM
Old 03-04-2017
Turn off exec 2>${_ERRORFILE} > ${_LOGFILE} feature?

Hi Folks -

To make a long story short, this script is loaded into a workbench, executed via workbench user interface, and then I need to display the output on screen. However, I'm using the functions to direct stdout and stderror to their respective directories.

Is there a way to turn that off so I can leverage the cat command? Else, when I place my cat commands just prior to the exits, it doesn't work.

Here is my script:

Code:
#!/bin/bash
#::------------------------------------------------------------------------
#::-- Script Name: FDMEE_Act_Load.sh
#::  
#::-- Description: This Script Executes the FDMEE RunBatch Utility
#::                
#::-- Paramaters:  Call setenv.sh to determine the following:
#::                 1. Login
#::                 2. Password
#::                 3. Server
#::                 4. Application
#::                 5. Database
#::                 6. etc
#::      
#::-- Author:        
#::-- Date:            
#:: ------------------------------------------------------------------------
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
    echo ${_LOGFILE}

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

#::-- 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 ------------------------------------------
  exit 0
else
    echo ------------------------------------------
    echo ${_SN%%.sh*} - Completed Unsuccessfully           
    echo ------------------------------------------
    echo ------------------------------------------
    echo Script Process Exiting Abnormally          
    echo ------------------------------------------
  exit 1
fi

Thank you!
 

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
SSH2_METHODS_NEGOTIATED(3)						 1						SSH2_METHODS_NEGOTIATED(3)

ssh2_methods_negotiated - Return list of negotiated methods

SYNOPSIS
array ssh2_methods_negotiated (resource $session) DESCRIPTION
Returns list of negotiated methods. PARAMETERS
o $session - An SSH connection link identifier, obtained from a call to ssh2_connect(3). RETURN VALUES
EXAMPLES
Example #1 Determining what methods were negotiated <?php $connection = ssh2_connect('shell.example.com', 22); $methods = ssh2_methods_negotiated($connection); echo "Encryption keys were negotiated using: {$methods['kex']} "; echo "Server identified using an {$methods['hostkey']} with "; echo "fingerprint: " . ssh2_fingerprint($connection) . " "; echo "Client to Server packets will use methods: "; echo " Crypt: {$methods['client_to_server']['crypt']} "; echo " Comp: {$methods['client_to_server']['comp']} "; echo " MAC: {$methods['client_to_server']['mac']} "; echo "Server to Client packets will use methods: "; echo " Crypt: {$methods['server_to_client']['crypt']} "; echo " Comp: {$methods['server_to_client']['comp']} "; echo " MAC: {$methods['server_to_client']['mac']} "; ?> SEE ALSO
ssh2_connect(3). PHP Documentation Group SSH2_METHODS_NEGOTIATED(3)
All times are GMT -4. The time now is 02:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy