calling sub-script in a command while


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting calling sub-script in a command while
# 1  
Old 11-25-2008
calling sub-script in a command while

Hi,

I am writting a script reading a liste of files from a file-list using the command while read NEW_LINE, and calling a "ksh" shell for each line.

My shell is like beside, and only the first line of the file-list of "/app/admin/file-list.txt" is actually processed. It seems that calling a script stop the loop of the command while.
The file /app/admin/file-list.txt isn't used in any other manner than with the command while.

Thanks you if you have any idea.


# ksh shell script
while read NEW_LINE
do
/app/admin/process_file.ksh $NEW_LINE
/app/admin/record_file.ksh $NEW_LINE
echo "NEW_LINE $NEW_LINE processed"
done < /app/admin/file-list.txt

Last edited by astjen; 11-26-2008 at 05:09 AM..
# 2  
Old 11-26-2008
The loop looks fine, the problem could be in the scripts you're running within the loop.
Try to run the scripts manually.

Regards
# 3  
Old 11-26-2008
I checked , but it seems to be a "stdin" problem, message bellow. But I don't know how to overpass it. a command for won't work line by line, and will probably crash with memory oversize failures.

By default, remsh reads its standard input and sends it to the remote command because remsh has no way to determine whether the remote command requires input. The -n option redirects standard input to remsh from /dev/null. This is useful when running a shell script containing a remsh command, since otherwise remsh may use input not intended for it.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell Script run curl command calling cyber-Ark RESTAPI

Hi All, We have a requirement to Integrate Cyber-Ark with Informatica . Basically cyberark will contain the username and password for Database. First step will be 1)In shell Script run curl command calling cyber-Ark RESTAPI requesting the credentials and store the secret in a variable. ... (0 Replies)
Discussion started by: Praveena9102
0 Replies

2. Shell Programming and Scripting

Calling another Script from Command Line in UNIX

Hi all, I am having problem in understanding the following line of code .. /home/rmsbatch/autoscript/autorms.ksh dc_load_main.ksh -q belk_dc_load_tran_data.seq What's being done here ? what does "-q" means ? What does ".seq" file means in unix "belk_dc_load_tran_data.seq" Please... (3 Replies)
Discussion started by: LoneRanger
3 Replies

3. UNIX for Dummies Questions & Answers

Help with reading and calling a command in a script

The problem I am having now is calling and reading a command and The Main script reads the data file and passes the input to the two calculation scripts, and than output to a file. 1. The Main Script ----------------- input=inputfilepj3 output=outfilepj3 echo "*** Converting... (2 Replies)
Discussion started by: TheUnitedOSI
2 Replies

4. UNIX for Dummies Questions & Answers

Calling Macros in UNIX command

Hi .. I have created a sql macro, i want to execute this through ksh in putty.ie) sql.ksh will contain the macro query ,once i call this ksh ,the macro should trigger. I am able to write a macro : for ex: create macro macro_name (sel * from db_tablename) execute macro_name. Could... (1 Reply)
Discussion started by: Kalaiselvi66
1 Replies

5. Programming

Calling UNIX command fron FORTRAN

I want to run the unix command in a fortran code echo trim(val_fgsize) | awk '{split($1, a, "/"); print a}'I am trying like this but getting problems s='echo ' // trim(val_fgsize) // '| awk '{split($1, a, "/"); print a}'' call system(s) ---------- Post updated at 05:15 PM ----------... (1 Reply)
Discussion started by: kristinu
1 Replies

6. Shell Programming and Scripting

calling a shell script present on another server using perl script.

Hi, I am working on a sever A. I want to write a perl script to execute a shell script persent on the server B. please help me in this. thanks in advance. (3 Replies)
Discussion started by: anandgodse
3 Replies

7. Shell Programming and Scripting

Syntax error calling TCL script from shell script

hello everyone i am beginner on shell scripting .and i am working on my project work on ad hoc network i wrote a batch (.sh) to do a looping and execute a tcl script i wrote before in each iteration ..but i got this problem " syntax error near unexpected token `('... (1 Reply)
Discussion started by: marcoss90
1 Replies

8. Shell Programming and Scripting

Calling bash command in perl script

Hi, I have tried several times but failed, I need to call this script from the perl script. This one line script will be sent to /var/tmp/error Bash command: /usr/openv/netbackup/bin/admincmd/bperror -backstat -l -hoursago 12 |awk '{ print $19, $12, $14, $16}'|grep -vi default|sort >... (12 Replies)
Discussion started by: sQew
12 Replies

9. Shell Programming and Scripting

passing a variables value from the called script to calling script using ksh

How do i get the value of the variable from the called script(script2) to the calling script(script1) in ksh ? I've given portion of the script here to explain the problem. Portion of Script 1 ============= ----- ----- tmp=`a.ksh p1 p2 p3` if then # error processing fi -----... (10 Replies)
Discussion started by: rajarkumar
10 Replies

10. UNIX for Dummies Questions & Answers

Java program calling a UNIX command

I was wondering if it was possible to call a unix command directly from a Java program during run-time. This command could very very basic e.g. "ps -ef" returned as a string, all I need is a starting place so if anyone has any suggestion or examples I would be very grateful (2 Replies)
Discussion started by: QUartz Ite
2 Replies
Login or Register to Ask a Question