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
load_datafile(3alleg4)						  Allegro manual					    load_datafile(3alleg4)

NAME
load_datafile - Loads a datafile into memory. Allegro game programming library. SYNOPSIS
#include <allegro.h> DATAFILE *load_datafile(const char *filename); DESCRIPTION
Loads a datafile into memory in one go. If the datafile has been encrypted, you must first call packfile_password() to set the appropriate key. If the datafile contains truecolor graphics, you must set the video mode or call set_color_conversion() before loading it. Example: /* Load the resources for our game. */ DATAFILE *dat = load_datafile("game.dat"); if (!dat) abort_on_error("Couldn't load sound resources!"); /* Use resources. */ ... /* Destroy them when we don't need them any more. */ unload_datafile(dat); RETURN VALUE
Returns a pointer to the DATAFILE, or NULL on error. Remember to free this DATAFILE later to avoid memory leaks. SEE ALSO
load_datafile_callback(3alleg4), unload_datafile(3alleg4), load_datafile_object(3alleg4), set_color_conversion(3alleg4), fixup_datafile(3alleg4), packfile_password(3alleg4), find_datafile_object(3alleg4), register_datafile_object(3alleg4), excustom(3alleg4), exdata(3alleg4), exexedat(3alleg4), exgui(3alleg4), exsprite(3alleg4), exunicod(3alleg4) Allegro version 4.4.2 load_datafile(3alleg4)
All times are GMT -4. The time now is 11:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy