Sponsored Content
Top Forums Shell Programming and Scripting Order text display not correct. Post 302144675 by raccsdl on Friday 9th of November 2007 05:36:25 AM
Old 11-09-2007
Order text display not correct.

My shell script below for import data to Oracle

it run okay. but the text display not correct follow order command executed.

=========================Shell Script code=================

#!/bin/sh

#directory = ${1-'pwd'}


#run import data with SQLLoader
runSQLLoader()
{
/home/oracle/app/oracle/product/11.1.0/db_2/bin/sqlldr test/12345@orcl control=$1 bad=$2 log=$3 discard=$4 data=$5 direct=TRUE;
if [$? -ne 0]
then
return 1
else
return 0
fi
}

ARGS=1
filecontrol="ControlFile/test.ctl"

if [ $# -ne "$ARGS" ];
then
directory=`pwd`
else
directory=$1
fi

for file in $(find $directory -type f )
do
fname=`basename $file`

#display the file to miport data
echo "Excute importing file : $fname "

#asking user waiting for this job finish
echo "Please waiting for you look finished task"

errorfile="Error/$fname"
processedfile="Processed/$fname"
badfile="Processed/bad$fname"
discardfile="Processed/discard$fname"
logfile="Processed/log$fname"

#run function above
runSQLLoader $filecontrol $badfile $logfile $discardfile $file;
#get result of importing data if 1 have error or 0 it importing okay
if [$? -ne 0]
then
echo "Error ! Have an error happen during import data "
mv "$file" "$errorfile"
else
echo "Finish importing file : $fname"
mv "$file" "$processedfile"
fi
done | sort

exit 0
======================End Shell Script code=================

Result display is not correct

Excute importing file : test01
Excute importing file : test02
Finish importing file : test01
Finish importing file : test02
Load completed - logical record count 6369.
Load completed - logical record count 7925.
Please waiting for you look finished task
Please waiting for you look finished task
SQL*Loader: Release 11.1.0.6.0 - Production on Fri Nov 9 04:20:30 2007
SQL*Loader: Release 11.1.0.6.0 - Production on Fri Nov 9 04:20:31 2007

correct order must be like this

Excute importing file : test01
Please waiting for you look finished task
SQL*Loader: Release 11.1.0.6.0 - Production on Fri Nov 9 04:20:30 2007
Load completed - logical record count 6369.
Finish importing file : test01

Excute importing file : test02
Please waiting for you look finished task
SQL*Loader: Release 11.1.0.6.0 - Production on Fri Nov 9 04:20:31 2007
Load completed - logical record count 7925.
Finish importing file : test02

I did not why it display like that. Smilie


Please help me for correct order follow my run command in script ?
or please explain for me more about what happen when I print out the text. Smilie

Thank so much for your help.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Echo display alignment/sort order

Hi, My script prints a few varibales as each it reads each line of a text file and then prints them on screen, however iam having problem in aligning and sorting them. what happens is this Last First Number Mark leo 87798798... (1 Reply)
Discussion started by: shackman66
1 Replies

2. UNIX for Advanced & Expert Users

Display modified files in ascending order

Hello, i want to display modified files in descending order. "ls -t" will display modified files in descending order. pls help. (1 Reply)
Discussion started by: balareddy
1 Replies

3. Shell Programming and Scripting

Ascending order within text

I appreciate all the help that I've already received but am running into one problem. I can find how to add something before a file with ascending numbers but not like this. I basically have a file that looks like this: 100 101 102 103 104 I need to add the following before each line with... (5 Replies)
Discussion started by: kerpm
5 Replies

4. Shell Programming and Scripting

Unable to get the correct sort order in perl.

Hi, I have created the hash. %hash; @arr1 = qw(Dealnum AdminStatus adminReason effFrom effTo); @arr2 = qw(121212121 YES 1992-06-19T05:14:27 ); @hash{@arr1}=@arr2; foreach(sort keys %hash){ print "$_ ---- $hash{$_}\n"; } The output i got like this: C:\strawberry\perl\bin>perl... (1 Reply)
Discussion started by: vanitham
1 Replies

5. UNIX for Advanced & Expert Users

v$sql not display correct sql_text

Hi folks, I am facing one problem with v$sql, i need to store updating sql query in temp table when one trigger get fired on some update sql statement. but with "sql_text" , i am not getting correct update statement in temp table. I am getting sql_text with this cursor statement. select... (0 Replies)
Discussion started by: apskaushik
0 Replies

6. UNIX for Dummies Questions & Answers

Text order

Hello unix.com I have a large text file in this format: merali guzman 34 vernon st 304 hartford CT Connecticut 6106 012-233-232 Working 13/14 100$ Morgan Dvorak 5670 Echo Road Excelsior MN Minnesota 5331 000-000-123 Sleeping 15/17 220$ How can... (1 Reply)
Discussion started by: galford
1 Replies

7. UNIX for Dummies Questions & Answers

Email display not correct on Solaris 10

Hi Everyone, Can someone possibly point me in the direction? When I execute command echo "hello" | sendmail -v testacct@wyx.com I recived an email as expected except the From: NAME is incorrect. The server name is correct. It should read "From: TESTBOX1 " actual email: From: app... (3 Replies)
Discussion started by: smckech1972
3 Replies

8. Shell Programming and Scripting

How to print the output in correct order?

Hi, while using following awk commend I’m getting confused, The output is not like as the row present in input files, can anyone explain and tell me how to print in the order like in input. value=$(awk 'FNR>1 && NR==FNR{a=$4;next} a{sum+=$4} END {for(i in sum){printf i"\t"sum/2"@@";}}'... (5 Replies)
Discussion started by: Shenbaga.d
5 Replies

9. Linux

How to display all daemon processes in priority order?

Hi, Is there any way to run chkconfig --list and to display all daemon processes in PRIORITY order, not in alphabetic order? Thank you. (4 Replies)
Discussion started by: hce
4 Replies

10. Shell Programming and Scripting

Display calendar in correct format using shell script

Hi All, I'm trying to print calendar using shell script and i'm able to print it. But the format is not good. Here is the script. #!/bin/bash echo $(date) echo "Hello $USER" echo Hostname $(hostname) echo Working in $(pwd) echo Here is this month calender echo $(cal) $ sh first.sh... (7 Replies)
Discussion started by: chandrakanth
7 Replies
native::Base(3) 					User Contributed Perl Documentation					   native::Base(3)

NAME
SVN::Base - Base class for importing symbols for svn modules SYNOPSIS
# Load the svn_ra_* functions into the SVN::Ra namespace. package SVN::Ra; use SVN::Base qw(Ra svn_ra_); # Load svn_config_t structure accessors in the magic namcespace # provided by swig, so we could use it returned by other functions package _p_svn_config_t; use SVN::Base qw(Core svn_config_); DESCRIPTION
SVN::Base is a module importing the subversion perl bindings raw symbols created by swig, into proper namespace and make them easier to use. It will also find the accessors for members of a C struct, create an simpler accessor function like "$data->field()" and "$data->field($new_value)". Once you understand the convention of subversion functions in perl bindings, you could look at the subversion api and write them in perl. The API is available in the source header files or online at http://svn.collab.net/svn-doxygen/. INTERNALS
The perl bindings of swig wraps raw functions into different perl modules, for example, SVN::_Core, SVN::_Repos. Upon import, SVN::Base bootstrap the requested module if it's not yet loaded, and iterate over the symbols provided in that module, it them puts the function with prefix trimmed in the namespace of the caller for this import. The 3rd through the last parameter is a list of symbol endings that you wish for SVN::Base not to import into your namespace. This is useful for cases where you may want to import certaion symbols differently than normally. CAVEATS
SVN::Base consider a function as structure member accessor if it is postfixed ``_get'' or ``_set''. Real functions with this postfixes will need extra handling. AUTHORS
Chia-liang Kao <clkao@clkao.org> COPYRIGHT
Copyright (c) 2003 CollabNet. All rights reserved. This software is licensed as described in the file COPYING, which you should have received as part of this distribution. The terms are also available at http://subversion.tigris.org/license-1.html. If newer versions of this license are posted there, you may use a newer version instead, at your option. This software consists of voluntary contributions made by many individuals. For exact contribution history, see the revision history and logs, available at http://subversion.tigris.org/. perl v5.10.0 2004-12-04 native::Base(3)
All times are GMT -4. The time now is 02:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy