Sponsored Content
Top Forums Shell Programming and Scripting ksh script failed while using -x Post 302704455 by Corona688 on Friday 21st of September 2012 03:33:08 PM
Old 09-21-2012
You're not actually using arrays for anything, though, you're just doing string splitting which can happen without using arrays at all.
Code:
STR="`cat file`"
echo $STR

But you don't need to load the entire file into a string at all. There's usually no reason to do that.

Code:
$ awk -v ORS=" " '{ sub(/[\\]/, ""); $1=$1 } 1; END{ printf("\n") }' inputfile

+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


Last edited by Corona688; 09-21-2012 at 04:39 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
Xmark(1)						      General Commands Manual							  Xmark(1)

NAME
Xmark - summarize x11perf results SYNTAX
Xmark datafile DESCRIPTION
Xmark is a shell script that reads the indicated datafile and compiles a benchmark which it writes to standard output. It writes three numbers: A weighted performance number for the x11perf results. A weighted performance number for a standard SparcStation 1, with SunOS 4.1.2, X11R5 Xsun, and a CG3 dumb Color Frame Buffer. The Xmark, which is the ratio of the two numbers above. The datafile must be an ordinary file, produced by x11perf in the following way: x11perf -display display -v1.3 -rop GXcopy GXxor -all > datafile It is possible to run the GXcopy and GXxor tests separately, as long as they are concatenated to the same output file: x11perf -display display -v1.3 -rop GXcopy -all > datafile x11perf -display display -v1.3 -rop GXxor -all >> datafile or x11perf -display display -v1.3 -rop GXxor -all > datafile x11perf -display display -v1.3 -rop GXcopy -all >> datafile FILES
temp.$$ Temporary file created in the current directory, deleted after use. DIAGNOSTICS
Usage: Xmark datafile Xmark was invoked without arguments or with more than one argument, or with options. Xmark takes no options. Error: data file does not exist or is not ordinary. Xmark cannot find the datafile named on its command line, or the datafile is a special file such as a directory. WARNING: datafile contains nnn, not 441 or 447 'trep' results; The file named on the command line does not seem to be a file generated by x11perf in the expected way. Diagnostic: ERROR: sum of weights =nnn, not equal to 4566.0; There is an internal error in Xmark. SEE ALSO
X(7), x11perf(1), x11perfcomp(1) X Version 11 x11perf 1.5 Xmark(1)
All times are GMT -4. The time now is 10:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy