944,196 Members | Top Members by Rank

Ad:
Feb 27th, 2006
0

A wierd problem

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
abhinav_shah is offline Offline
4 posts
since Feb 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Shell Scripting Forum Timeline: command line arguments problem.
Next Thread in Shell Scripting Forum Timeline: Need some help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC