Editing file during running ksh in HP failed


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Editing file during running ksh in HP failed
# 1  
Old 08-05-2004
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 = /xbip-HPCD2/Html/
.
w
q
EOF

As you can see,i'm doing editing changes in a file during a ksh running ,as user root.
In HP this program fails and exit with status 2.
In Sun it succeeds.

Is anyone have an idea why does it fail?

Thanks in advance,
Nir
# 2  
Old 08-05-2004
Works fine for me on HP-UX 10 and under SuSE Linux 8.2

You'll get an exit status of 2 if the file doesn't already exist, or if you try to delete ("d") lines that don't exist - i.e. if the file is empty.

Cheers
ZB
# 3  
Old 08-05-2004
Hi ZB,

You are right.
Eventually,my file was not valid.
I've created a new file with the same lines and the program has run successfully ,both on HP and Sun.

Thanks.
Nir
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Running a KSH file from VPS on Godaddy

i have looked for a week and tried a few things, but nothing seems to work so joined here. I have a go daddy account and also a vps in germany. In my vps, i run a code script (we will call it codegen) when i run ./codegen i get my question of how many codes do i want to make. With my answer... (9 Replies)
Discussion started by: uksatman
9 Replies

2. Shell Programming and Scripting

ksh script failed while using -x

Hi, I have a Kshell script that is failed if i am using the -x option. $ cat ListOfFiles.lst \+DATA_DM01/pudwh/datafile/dw_billing_tts_1 \+DATA_DM01/pudwh/datafile/dw_billing_tts_2 ... (2 Replies)
Discussion started by: yoavbe
2 Replies

3. Shell Programming and Scripting

Editing crontab via ksh

Hi all, I am trying the following I am hoping that the crontab would be changed. but it prints the previous crontab and says Can anyone tell me the correct ksh command that should be used here? I don't want to edit the crontab with crontab -e, I need to edit it via ksh. Thank... (2 Replies)
Discussion started by: ajaba
2 Replies

4. Shell Programming and Scripting

csv file editing using KSH

I'm trying to write a shell script to extract useful fields in a csv file and copy them to a new file: the input file is as below when opened using notepad++: //////////////////////////////////////////////////////////// ZZZZZZZZZZZZZZZZZZZZZZ ,"A", , , ,24,18,0,0,42,0 , ,B, ,... (1 Reply)
Discussion started by: zekruss
1 Replies

5. Shell Programming and Scripting

Simple script editing text files and running commands

Okay this will probably have multiple parts to it but I don't really want to trouble you guys with more help because I'm a total noob so I can just do the first part by hand (it's just editing a few hundred lines of text in a file; I have to do the same thing on each line and I'm sure there's a... (2 Replies)
Discussion started by: guitarscn
2 Replies

6. UNIX for Dummies Questions & Answers

ksh command line editing text being overwritten

hi. i'm using ksh with set -o vi. if i am far down in a directory and try to edit the command line (esc-k to retrieve previous command) the cursor is being positioned over to the left on top of the directory text making the text very difficult to read or work with. seems to be problem with long... (2 Replies)
Discussion started by: jeffa123
2 Replies

7. Shell Programming and Scripting

How to fetch running/failed process

I am trying to fetch failed process but while doing that unable to do so. like; (1)ps -ef | grep snmpCollect o/p is coming like - root 12423 4393 1 19:44:06 pts/0 0:00 grep snmpCollect (2)ps -ef | grep sttps o/p- root 15517 4393 0 19:53:24 pts/0 0:00 grep sttps... (6 Replies)
Discussion started by: kumarabhi84
6 Replies

8. Shell Programming and Scripting

Editing a ksh script > Please assist!

I am trying to edit a script that contains the following: /DBA/general/sh/rman_backup.ksh -d PROD2 -l 1 I am trying to add a logic in the script such that if /DBA/general/sh/rman_backup.ksh does not exists, then the script would return an error code of 1. Otherwise, the script continues... (4 Replies)
Discussion started by: ora_umair
4 Replies

9. 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

10. Filesystems, Disks and Memory

skgpspawn failed running oracle db 9.2.0.5.0 on aix 5.3

Hi, I am running an oracle db 9.2.0.5.0 on ibm p5 550 aix 5.3 with 10g ram, 10G swap space 3 database instances each SGA about 500Meg. I am getting the following error in my alert log file from time to time: skgpspawn failed:category = 27142, depinfo = 11, op = fork, loc = skgpspawn3 ... (0 Replies)
Discussion started by: hawkerpacific
0 Replies
Login or Register to Ask a Question