Change Param File Variable Test Mode Value


 
Thread Tools Search this Thread
Operating Systems AIX Change Param File Variable Test Mode Value
# 1  
Old 03-17-2016
Change Param File Variable Test Mode Value

First two days of shell scripting... I've looked at awk/sed and man sed only to get off into the weeds of complexity that may not be needed here...

hints for awk or sed or other method to magically change the bolded item below?

Nutshell: HFTST=Y #test mode = true to false & back again so script remains default test mode = true; ref #magically toggles... I may run another pre-emptive script to always toggle to Y in case DTTRProc errors and doesn't reset automagically

First six lines of MCSB475CA.dat parmater file for INT0013CA shell script
Code:
# [HEADER]
HFTST=Y
HFTPP=000000107             
HFTPP=000000040             
# [DETAIL]
HCCLM=HIC
....

Section of DTRRProc shell script file as wrapper to locate oldest $i file process & move to archive folder as well as retrieve output files created by INT0013CA

Code:
tMode()
{
#magically toggles HFTST=[Y,N] in MCSB475CA.dat file
}

HSTST=
if [[ $2 >/dev/null ]];then
case $2 in "N") HSTST=$2 tMode $HSTST ;; *) HSTST=Y tMode $HSTST ;; esac
fi #call shell script that wiill use MCSB475CA.dat as parameter file

...$i is a path & file to process
Code:
INT0013CA $i>>DTRR_Log
...
#toggle back to test mode
HSTST=Y
tMode $HSTST


Last edited by Scrutinizer; 03-17-2016 at 05:19 AM.. Reason: code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Test if Remote server is up and running before SFTP'ing files (in batch mode)

Hello, In our Data Warehouse environment, before our batch SFTP jobs kick off to pull the files from remote servers, I would like to setup a pre-sftp job that would test if all the remote servers from where the files are being pulled, are up and running. If any one of the remote serer is... (2 Replies)
Discussion started by: Dippu
2 Replies

2. UNIX for Advanced & Expert Users

Change mode drwxrwsr-x+ directory

Hi, How to change mode "drwxrwsr-x+" in directory. I'm able to set drwxrwsr-x but "+" is difficult to set. ~ $ las -las | grep done1 4 drwxrwsr-x+ 3 root sfuser 4096 Nov 26 16:39 done1 ~ $ getfacl done1 # file: done1 # owner: root # group: sfuser # flags: -s- user::rwx... (4 Replies)
Discussion started by: justbow
4 Replies

3. Shell Programming and Scripting

File test commands with variable file name

Hi there I have the following code SDFFILE_SRC=$BACKEND_DIR/$SDFFILE_MIN_tar SDFFILE_DST=$SIM_DIR/$SDFFILE_MIN if ] .... .... .... fi Simply I need to check if $SDFFILE_SRC isa newer than $SDFFILE_DST or $SDFFILE_DST does not exist then execute the IF Body. Although the the... (2 Replies)
Discussion started by: aelhosiny
2 Replies

4. Shell Programming and Scripting

Change the value of variable in a file

Hi Friends, I have shell script file1.sh which has reference to enviornment file called Content of filenev.sh SKIP_FLAG=N ORACLE_HOME=/u01/oracle/database My requirement is to change the value of SKIP_FLAG to Y in filenv.sh from file1.sh. Could anyone please help me to do... (2 Replies)
Discussion started by: vfrg
2 Replies

5. Shell Programming and Scripting

Reading selected lines from a param file

Hi all, I have a question for the Gurus. I apologize if this has bee shared before but I couldn't find the link. I am trying to read parameters from an external parameter file. What I m trying to achieve is read selected lines from an external parameter file into the script. for eg my param... (4 Replies)
Discussion started by: maverick1947
4 Replies

6. Shell Programming and Scripting

one line command to change mode only if necessary

hi, sorry for posting this for a quick answer. Is there a one line command to change permissions on files in a directory to a given mode (say 554) and only for those files that do not already have that mode? Running chmod updates the last access/modified timestamp on the files, and i want to... (11 Replies)
Discussion started by: ysrini
11 Replies

7. Shell Programming and Scripting

change the mode of the file after FTP

Hi I am FTPing a file to a remote server from my local server. But after I FTP it the permissions are not in executable option, I need to change the permissions of the FTPed file how can i do that. Below is my script LOCALDIR=/batch/ediprocess LOCAL_BACKUP_DIR/batch/ediprocessBackUp... (4 Replies)
Discussion started by: shanth_chandra
4 Replies

8. Shell Programming and Scripting

how to change the variable in the file

Hi all, I have problem regarding how to change the quantity in the file. I will explain you by an example. I have one file whose name is sample. The content of file are as follows: sample ----------------------------------------------------------- 1 334 3562 2345 5324 85657 75666 845 ... (0 Replies)
Discussion started by: Aniket
0 Replies

9. UNIX for Dummies Questions & Answers

Script for reading filelist and preparing param file.

Hi All, Not sure if this would be in a dummies sectiin or advanced. I'm looking for a script if someone has doen something like this. I have list of files - adc_earnedpoints.20070630.txt adc_earnedpoints.20070707.txt adc_earnedpoints.20070714.txt adc_earnedpoints.20070721.txt... (2 Replies)
Discussion started by: thebeginer
2 Replies

10. UNIX for Dummies Questions & Answers

How do I change IP addresses in command mode...

How do I change IP addresses in command mode? i need to assign custom (non DHCP) addresses from the command line. Actually I also need to know how to change the subnet mask, the gateway and the primary, secondary, ... dns servers. (6 Replies)
Discussion started by: Super.Anyak
6 Replies
Login or Register to Ask a Question