Sponsored Content
Top Forums Shell Programming and Scripting Output file not displayed in the proper format Post 302384620 by weknowd on Wednesday 6th of January 2010 04:29:25 AM
Old 01-06-2010
Thanks for the reply here is my code ,can you please give the commands or the changes i need to do.....

Code:
par_file="/dlxfiles/BWParam/OPTIM/NPI.param"
conn_input_file="/dlxfiles/BWParam/OPTIM/all_cons.txt"

yyyymmdd=`date +%Y%m%d`

#SQL_OP="/dlxfiles/TgtFiles/OPTIM/audit_report_ci.txt"
CNT_FILE="/dlxfiles/TgtFiles/OPTIM/audit_report_ci_counts_$yyyymmdd.txt"

rm /dlxfiles/TgtFiles/OPTIM/audit_report_ci.doc
touch /dlxfiles/TgtFiles/OPTIM/audit_report_ci.doc

rm $CNT_FILE
touch $CNT_FILE
#chmod 777 $SQL_OP


for conn_name in `cat $conn_input_file`
do

echo "[C000134.WF:wflw_s_m_Load_NPI_AUDIT.ST:s_m_Load_NPI_AUDIT]" > $par_file
echo "\$DBConnection_Source"=$conn_name>> $par_file
DB_NM=`echo $conn_name | cut -d "_" -f2`

echo "\$\$DBNAME=$DB_NM">>$par_file
echo "\$DBConnection_Target=ADDRLBL_CID1_ETLUSER">> $par_file
echo "\$PMBadFile=/dlxfiles/BadFiles/OPTIM/s_m_Load_NPI_AUDIT.bad">>$par_file
echo "\$PMSessionLogFile=/dlxfiles/SessLogs/OPTIM/s_m_Load_NPI_AUDIT.log">>$par_file
echo "\$PMWorkflowLogDir=/dlxfiles/WorkflowLogs/OPTIM/wflw_s_s_m_Load_NPI_AUDIT.log">>$par_file

Sq_op_file="/dlxfiles/TgtFiles/OPTIM/audit_report_ci_"${DB_NM}"_$yyyymmdd.txt"
echo "#!/usr/bin/sh" >  /dlxfiles/TgtFiles/OPTIM/sql_op.sh
echo "SQL_OP="${Sq_op_file} >> /dlxfiles/TgtFiles/OPTIM/sql_op.sh
echo "export $SQL_OP;" >>  /dlxfiles/TgtFiles/OPTIM/sql_op.sh

. /dlxfiles/Scripts/SHARED/run_infa_workflow.sh C000134 wflw_s_m_Load_NPI_AUDIT

cnt=`cat $Sq_op_file | grep ${DB_NM} |  wc -l`
echo "Total matches found for ${DB_NM}: "$cnt >>$CNT_FILE

uuencode $Sq_op_file $Sq_op_file >> /dlxfiles/TgtFiles/OPTIM/audit_report_ci.doc

done

mailx -s 'Matches' xxx@x.com<  /dlxfiles/TgtFiles/OPTIM/audit_report_ci.doc



---------- Post updated at 05:29 AM ---------- Previous update was at 03:40 AM ----------

Please help me in giving solution.Its somewhat urgent.

Last edited by Franklin52; 01-06-2010 at 04:16 AM.. Reason: Please use code tags!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check for proper e mail id format

Hi, We run an application called meta which reads user information from database and updates in LDAP.For that we have some scripts to check the uniqueness of mail ids between the existing LDAP and Database.It works fine when people enter mail ids in proper format (xxx.yyy@abc.com) but if it... (2 Replies)
Discussion started by: prolay
2 Replies

2. Shell Programming and Scripting

Net::SSH::Perl ...... how to print the output in a proper format

Hi Guys, my $cmd = "ls -l"; #........ {or let it be as # my $cmd= "ls"; } my $ssh = Net::SSH::Perl->new($host); $ssh->login($user, $pass); my($stdout, $stderr, $exit) = $ssh->cmd("$cmd"); print $stdout; the script works fine, but i am unable to see the output getting displayed in a... (7 Replies)
Discussion started by: gsprasanna
7 Replies

3. Shell Programming and Scripting

Dynamic output file generation using a input text file with predefined output format

Hi, I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format. Example: File.txt AP|{SSHA}VEEg42CNCghUnGhCVg== APVG3|{SSHA}XK|"password" AP3|{SSHA}XK|"This is test" .... etc --------- test.sh has... (1 Reply)
Discussion started by: hudson03051nh
1 Replies

4. Shell Programming and Scripting

Getting Proper Date Format in SH Script

There's a small SH script I'm trying to write where it will get the current month and find a log file that is based on the date. Example: Today is February, so the log file is going to be 201102.log (2011 + 02) An additional thing is that if today is the 1st of a month, it will also find the log... (3 Replies)
Discussion started by: kooshi
3 Replies

5. Shell Programming and Scripting

Need to split a xml file in proper format

Hi, I have a file which has xml data but all in single line Ex - <?xml version="1.0"?><User><Name>Robert</Name><Location>California</Location><Occupation>Programmer</Occupation></User> I want to split the data in proper xml format Ex- <?xml version="1.0"?> <User> <Name>Robert</Name>... (6 Replies)
Discussion started by: avishek007
6 Replies

6. Shell Programming and Scripting

perl - output not being displayed

Hi All I have the following code sub pall_nvrm { my $cmd = `pall -w "/u/ab/scripts/dev/nvrmerros/nvrmpaller"`; print $cmd; } if i run pall -w "/u/ab/scripts/dev/nvrmerros/nvrmpaller" in a shell i get this sort of out put eagley: boxted: cadle: eabost: hales: (3 Replies)
Discussion started by: ab52
3 Replies

7. Shell Programming and Scripting

Format of content displayed in the attachment of email

Hi, I'm facing a problem in mailing attachments using uuencode in mailx. I got to attach a couple of flatfiles. I'm able to attach and mail the files successfully. But there is a problem in the format of the flatfiles when they are received as an attachemnt. For Example : Consider... (0 Replies)
Discussion started by: Sindhuap
0 Replies

8. Shell Programming and Scripting

Awk - Summation in Proper decimal Format

Hi I am executing below command to do summation on 46th coloumn. cat File1| awk -F"|" '{p += $46} END { printf"Column Name | SUM | " p}' I am getting output as Column Name | SUM | 1.01139e+10 Here I want output in Proper decimal format. Can someone tell me what change is required for same? (1 Reply)
Discussion started by: sanranad
1 Replies

9. Shell Programming and Scripting

Need to grep this Data in proper format:- Please Guide

Hi Guys, I need to grep below data in this format backup_id creation expiration policy sched_label backup_id = picoserver38_1212077050, version = 2 creation = 05/29/2008 18:04:10 (1212077050) expiration = 06/29/2008 18:04:10 (1214755450) retention_level = 3, fragment = 2, file_num = 1... (14 Replies)
Discussion started by: manalisharmabe
14 Replies

10. Shell Programming and Scripting

Combine multiline to one line with proper format

Hello Guys, I have a file say FILE1.txt contains below data:- A B C D E F G H I J K L I need the output in another file as FILE2 as:- 'A', 'B', 'C', 'D', 'E', (7 Replies)
Discussion started by: jassi10781
7 Replies
APC_CAS(3)								 1								APC_CAS(3)

apc_cas - Updates an old value with a new value

SYNOPSIS
bool apc_cas (string $key, int $old, int $new) DESCRIPTION
apc_cas(3) updates an already existing integer value if the $old parameter matches the currently stored value with the value of the $new parameter. PARAMETERS
o $key - The key of the value being updated. o $old - The old value (the value currently stored). o $new - The new value to update to. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 apc_cas(3) example <?php apc_store('foobar', 2); echo '$foobar = 2', PHP_EOL; echo '$foobar == 1 ? 2 : 1 = ', (apc_cas('foobar', 1, 2) ? 'ok' : 'fail'), PHP_EOL; echo '$foobar == 2 ? 1 : 2 = ', (apc_cas('foobar', 2, 1) ? 'ok' : 'fail'), PHP_EOL; echo '$foobar = ', apc_fetch('foobar'), PHP_EOL; echo '$f__bar == 1 ? 2 : 1 = ', (apc_cas('f__bar', 1, 2) ? 'ok' : 'fail'), PHP_EOL; apc_store('perfection', 'xyz'); echo '$perfection == 2 ? 1 : 2 = ', (apc_cas('perfection', 2, 1) ? 'ok' : 'epic fail'), PHP_EOL; echo '$foobar = ', apc_fetch('foobar'), PHP_EOL; ?> The above example will output something similar to: $foobar = 2 $foobar == 1 ? 2 : 1 = fail $foobar == 2 ? 1 : 2 = ok $foobar = 1 $f__bar == 1 ? 2 : 1 = fail $perfection == 2 ? 1 : 2 = epic fail $foobar = 1 SEE ALSO
apc_dec(3), apc_store(3). PHP Documentation Group APC_CAS(3)
All times are GMT -4. The time now is 05:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy