Sponsored Content
Top Forums Shell Programming and Scripting ksh script failed while using -x Post 302704435 by yoavbe on Friday 21st of September 2012 03:03:30 PM
Old 09-21-2012
ksh script failed while using -x

Hi,
I have a Kshell script that is failed if i am using the -x option.

Code:
$ cat ListOfFiles.lst
\+DATA_DM01/pudwh/datafile/dw_billing_tts_1                                     
\+DATA_DM01/pudwh/datafile/dw_billing_tts_2                                     
\+DATA_DM01/pudwh/datafile/dw_billing_tts_3                                     
\+DATA_DM01/pudwh/datafile/dw_billing_tts_4                                     
\+DATA_DM01/pudwh/datafile/dw_billing_tts_5                                     
\+DATA_DM01/pudwh/datafile/dw_billing_tts_6                                     
\+DATA_DM01/pudwh/datafile/dw_billing_tts_7                                     
\+DATA_DM01/pudwh/datafile/dw_billing_tts_8                                     
\+DATA_DM01/pudwh/datafile/dw_billing_tts_9                                     
\+DATA_DM01/pudwh/datafile/dw_billing_tts_10                                    
\+DATA_DM01/pudwh/datafile/dw_billing_tts_11                                    
\+DATA_DM01/pudwh/datafile/dw_billing_tts_12                                    
\+DATA_DM01/pudwh/datafile/dw_billing_tts_13                                    
\+DATA_DM01/pudwh/datafile/dw_billing_tts_14                                    
\+DATA_DM01/pudwh/datafile/dw_billing_tts_15                                    
\+DATA_DM01/pudwh/datafile/dw_billing_tts_16                                    
\+DATA_DM01/pudwh/datafile/dw_billing_tts_17 

cat test1.ksh
#!/bin/ksh
cat /home/oracle/ListOfFiles.lst
set -A FILE $(cat /home/oracle/ListOfFiles.lst)
echo FILE=${FILE[@]}
echo ${FILE[@]} | sed 's/ /,/g' | sed 's/\\//g' > /home/oracle/ListOfFiles.tmp

while executing the script WITHOUT the -x it finished successfully:
cat /home/oracle/ListOfFiles.tmp
+DATA_DM01/pudwh/datafile/dw_billing_tts_1,+DATA_DM01/pudwh/datafile/dw_billing_tts_2,+DATA_DM01/pudwh/datafile/dw_billing_tts_3,+DATA_DM01/pudwh/datafile/dw_billing_tts_4,+DATA_DM01/pudwh/datafile/dw_billing_tts_5,+DATA_DM01/pudwh/datafile/dw_billing_tts_6,+DATA_DM01/pudwh/datafile/dw_billing_tts_7,+DATA_DM01/pudwh/datafile/dw_billing_tts_8,+DATA_DM01/pudwh/datafile/dw_billing_tts_9,+DATA_DM01/pudwh/datafile/dw_billing_tts_10,+DATA_DM01/pudwh/datafile/dw_billing_tts_11,+DATA_DM01/pudwh/datafile/dw_billing_tts_12,+DATA_DM01/pudwh/datafile/dw_billing_tts_13,+DATA_DM01/pudwh/datafile/dw_billing_tts_14,+DATA_DM01/pudwh/datafile/dw_billing_tts_15,+DATA_DM01/pudwh/datafile/dw_billing_tts_16,+DATA_DM01/pudwh/datafile/dw_billing_tts_17

While it running with -x option it faild .
Please advise

Code:
sh -x test1.ksh
++ cat /home/oracle/ListOfFiles.lst
+ set -A FILE '\+DATA_DM01/pudwh/datafile/dw_billing_tts_1' '\+DATA_DM01/pudwh/datafile/dw_billing_tts_2' '\+DATA_DM01/pudwh/datafile/dw_billing_tts_3' '\+DATA_DM01/pudwh/datafile/dw_billing_tts_4' '\+DATA_DM01/pudwh/datafile/dw_billing_tts_5' '\+DATA_DM01/pudwh/datafile/dw_billing_tts_6' '\+DATA_DM01/pudwh/datafile/dw_billing_tts_7' '\+DATA_DM01/pudwh/datafile/dw_billing_tts_8' '\+DATA_DM01/pudwh/datafile/dw_billing_tts_9' '\+DATA_DM01/pudwh/datafile/dw_billing_tts_10' '\+DATA_DM01/pudwh/datafile/dw_billing_tts_11' '\+DATA_DM01/pudwh/datafile/dw_billing_tts_12' '\+DATA_DM01/pudwh/datafile/dw_billing_tts_13' '\+DATA_DM01/pudwh/datafile/dw_billing_tts_14' '\+DATA_DM01/pudwh/datafile/dw_billing_tts_15' '\+DATA_DM01/pudwh/datafile/dw_billing_tts_16' '\+DATA_DM01/pudwh/datafile/dw_billing_tts_17'
test1.ksh: line 3: set: -A: invalid option
set: usage: set [--abefhkmnptuvxBCHP] [-o option] [arg ...]

Thanks

Last edited by Corona688; 09-21-2012 at 04:17 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Editing file during running ksh in HP failed

Hi falks, I have the following program: #!/bin/ksh ed -s /home/ias/v9.0.3/j2ee/OC4J_RiGHTv_HPCD2/applications/Xbip/Xbip/WEB -INF/config/application.properties <<EOF >/dev/null 1 d . d . a application.filePath.core = /core-HPCD2/Html/ application.filePath.xbip =... (2 Replies)
Discussion started by: nir_s
2 Replies

2. Shell Programming and Scripting

tcsh user failed to call library in ksh program

Hi folks, I'm trying to organize functions in my ksh program into libraries. If I run my program as any ksh user it will succeed. Only when I run my program as tcsh user (i.e oracle) I failed. Example ======= The ksh code: tornado:/tmp # cat nir.ksh #! /bin/ksh cdromPath=`pwd`... (1 Reply)
Discussion started by: nir_s
1 Replies

3. Shell Programming and Scripting

executing a ksh script from another ksh script

Hi, I'm new to unix scripting.How can i call a script from another script. I have a.ksh and b.ksh .I have to call b.ksh from a.ksh after it is successfully exceuted. I tried using #!/bin/ksh -x in a.ksh and at the end i have used /path/b.ksh My problem is it is executing only a.ksh.it... (6 Replies)
Discussion started by: ammu
6 Replies

4. Shell Programming and Scripting

tracing a ksh script within a ksh script

I normally trace a script with the ksh -x <script name> and redirect strderr to file. But if you have a script like the examble below...... vi hairy bear=`grep bear animals` if then ksh more_animals fi If I ksh -x hairy it won't trace "more_animals" unless I put a -x in it. Is... (1 Reply)
Discussion started by: shorty
1 Replies

5. Shell Programming and Scripting

import var and function from ksh script to another ksh script

Ih all, i have multiples ksh scripts for crontab's unix jobs they all have same variables declarations and some similar functions i would have a only single script file to declare my variables, like: var1= "aaa" var2= "bbb" var3= "ccc" ... function ab { ...} function bc { ... }... (2 Replies)
Discussion started by: wolfhurt
2 Replies

6. Shell Programming and Scripting

Rerunning a command in a script that failed?

I have a script that occasionally has a command here and there that fails and I would like to set my script up to just re run the command if the exit code is 1. Is there a simple way to do that without if/thens or redirecting to the command again? (5 Replies)
Discussion started by: trey85stang
5 Replies

7. Shell Programming and Scripting

script for failed processes

I want to write a script that log all the failed processes and start the same process. For that I have already write a script that gives all the PID #!/bin/ksh pid= `ps -ef |grep "ov" |grep -v "grep"| awk '{print $2}'` echo $pid if ; then echo "process is running" else echo... (4 Replies)
Discussion started by: kumarabhi84
4 Replies

8. Shell Programming and Scripting

AWK script getting failed

Hi All, Below is my code , In the code below the "If" condition is getting failed. I dont know what is getting wrong here , may be i can not use may logical operator at once or something else OR brackets under If condition are to be organised . Please help!! if ($11 == "0" &&... (1 Reply)
Discussion started by: unknown123
1 Replies

9. Shell Programming and Scripting

KSH script to run other ksh scripts and output it to a file and/or email

Hi I am new to this Scripting process and would like to know How can i write a ksh script that will call other ksh scripts and write the output to a file and/or email. For example ------- Script ABC ------- a.ksh b.ksh c.ksh I need to call all three scripts execute them and... (2 Replies)
Discussion started by: pacifican
2 Replies

10. Shell Programming and Scripting

My script failed and can't fix it ?

Hi , I'd like to give you a little bit idea about my script which is used to get any generated file from remote server using ftp session then organized those file into directories based on their date ( at the end I supposed to have 1 months directories 20130401 20130402 ....20130430 ,... (27 Replies)
Discussion started by: arm
27 Replies
All times are GMT -4. The time now is 12:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy