A wierd problem

Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Feb 2006
Posts: 4
Reputation: abhinav_shah is an unknown quantity at this point 
Solved Threads: 0
abhinav_shah abhinav_shah is offline Offline
Newbie Poster

A wierd problem

 
0
  #1
Feb 27th, 2006
Hi !
This is the code of a script main.sh
Shell Scripting Syntax (Toggle Plain Text)
  1. while read line
  2. do
  3. chmod +x temp.sh
  4. ./temp.sh $line
  5.  
  6. done <test.txt

Now this script reads from a file test.txt and calls another script temp.sh.
Here is temp.sh
Shell Scripting Syntax (Toggle Plain Text)
  1. echo $1
  2. rsh alpha11.xyz.com ls

Now the problem is, after executing temp.sh in main.sh, the while loop exits without iterating and reading the next line from the file test.txt
Now, if I remove the line "rsh alpha11.xyz.com ls" from temp.sh then the loop works perfectly fine and it reads the next line from test.txt
I hope you understood my problem.

Can anybody help ?

Abhinav Shah
http://www.abhinav.frih.net
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Shell Scripting Forum
Thread Tools Search this Thread



Tag cloud for Shell Scripting
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC