Need support for a shell scripting problem


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Old 07-11-2017
Need support for a shell scripting problem

Hello all,

I am facing a weird issue while executing a code below -

Code:
#!/bin/bash
cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset
sh UKBA_publish.sh UKBA 28082015 3
if [ $? -eq 0 ]
then
echo "Param file conversion for all the areas are completed, please check in your home directory"
else
echo "The final PSET failed"
fi

When I execute it as a standalone code it works fine but when I execute it as a part of below mentioned script, it fails -
Code:
#!/bin/bash
param1=$1
param2=$2
param3=$3
email=$4
baot_id=$5
header_date_14=$(m_dump /wload/baot/app/data_abinitio/serial/uk_cust/ukrb_ukba_acnt_bde27_src.dml $param1 | head -35)
hdr_dt_14=$(echo "$header_date_14" | awk '$1=="bdfo_run_date" {print $2}')
julian_date_14=$(m_eval '(date("YYYYMMDD"))( unsigned integer(2)) '$hdr_dt_14'') 2>&1
header_date_15=$(m_dump /wload/baot/app/data_abinitio/serial/uk_cust/ukrb_ukba_acnt_bde27_src.dml $param2 | head -35)
hdr_dt_15=$(echo "$header_date_15" | awk '$1=="bdfo_run_date" {print $2}')
julian_date_15=$(m_eval '(date("YYYYMMDD"))( unsigned integer(2)) '$hdr_dt_15'')
header_date_16=$(m_dump /wload/baot/app/data_abinitio/serial/uk_cust/ukrb_ukba_acnt_bde27_src.dml $param3 | head -35)
hdr_dt_16=$(echo "$header_date_16" | awk '$1=="bdfo_run_date" {print $2}')
julian_date_16=$(m_eval '(date("YYYYMMDD"))( unsigned integer(2)) '$hdr_dt_16'')
echo "This is your Header date $julian_date_16"
if [ "$julian_date_14" = "$julian_date_15" -a "$julian_date_15" = "$julian_date_16" ]
then
echo All the dates from three input files are same
else
echo Check the file dates please
fi
cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset
Param_date=`echo $DATE_FINAL | cut -c7-8`
Param_month=`echo $DATE_FINAL | cut -c5-6`
Param_year=`echo $DATE_FINAL | cut -c1-4`
Param_date_1="$Param_date$Param_month$Param_year"
echo "Date to execute final PSET is $Param_date_1"
sh UKBA_publish.sh UKBA Date_FINAL 3
if [ $? -eq 0 ]
then
echo "Param file conversion for all the areas are completed, please check in your home directory"
else
echo "The final PSET failed"
fi
cd /wload/baot/app/data_abinitio/abinitio_UKBA_BDE_PUB_DISK/mfs/mfs_6way/EXTRACTS/UKBA/ext_ukba_bde_pub/main/daily
m_cp *$DATE_FINAL.SNAP.gz /wload/baot/home/$baot_id
cd
m_gunzip *20150828.SNAP.gz

Param1,Param2, Param3 and Param 4, Param 5 are required as a command line arguments.
Error is below -
Code:
Trouble creating layout "layout-Process_DETAIL.Rollup_to_account_level_within_files":

Failed computing working directory: No such file or directory
  Path = "mfile:/wload/baot/app/data_abinitio/abinitio_PBE_DISK/mfs/mfs_6way/EXTRACTS/UKBA/ext_ukba_bde/main/."

air sandbox run ukba_bde_validation_publish_ebcdic_TEST.pset failed
The final PSET failed

My point is why this code works as a standalone one and not with a script in the same environment. SmilieSmilieSmilie
I am using AIX.
Any pointers will be greatly appreciated.
# 2  
Old 07-11-2017
Code:
sh UKBA_publish.sh UKBA Date_FINAL 3

should it not be:
sh UKBA_publish.sh UKBA $Date_FINAL 3 ?
This User Gave Thanks to vbe For This Post:
ektubbe (07-11-2017)
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Shell scripting problem alex4o0o Shell Programming and Scripting 1 12-02-2017 03:54 AM
Problem scripting a copy and renaming shell executable ilovedoritos Shell Programming and Scripting 23 01-19-2015 06:02 PM
Shell Scripting awk Problem DisabledVet Shell Programming and Scripting 2 03-14-2013 01:57 PM
Shell Scripting needed for the below problem please solve ... hemanthsaikumar Shell Programming and Scripting 1 12-05-2012 02:27 AM
Shell Scripting Problem - Invalid Back Reference johnhisenburg Shell Programming and Scripting 1 07-19-2012 12:22 PM
Having problem with how to use HTML in Unix shell scripting anand.aswini Shell Programming and Scripting 2 05-09-2012 01:43 PM
Shell scripting newbie problem Tibor63 Shell Programming and Scripting 9 06-06-2011 01:50 AM
Shell Scripting Problem... ozman911 Homework & Coursework Questions 5 12-13-2010 09:06 PM
Problem in loops in shell scripting sudhir_83k Shell Programming and Scripting 5 10-08-2010 08:12 AM
Shell Scripting problem mahesh_raghu Shell Programming and Scripting 1 04-24-2010 07:19 AM
Shell scripting and ls -1 problem afroCluster Shell Programming and Scripting 7 09-03-2009 09:48 PM
Problem - gnome terminal shell scripting msteve2002 Shell Programming and Scripting 0 07-27-2009 08:39 AM
roles and responsibilites in unix shell scripting as a production support consultant alokjyotibal UNIX and Linux Applications 2 10-01-2008 06:27 PM
shell scripting problem mobydick Shell Programming and Scripting 1 07-08-2008 04:47 AM
Problem in for loop of shell scripting in solaris krevathi1912 Solaris 12 12-03-2007 07:36 AM