![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| file moving based on file content | melvyn.cochrane | Shell Programming and Scripting | 12 | 02-15-2008 02:10 AM |
| Moving lines within a txt file | innocentspirit | Shell Programming and Scripting | 5 | 09-27-2007 09:04 PM |
| Problem in moving files to .txt | mohdtausifsh | UNIX for Advanced & Expert Users | 2 | 03-26-2007 01:04 AM |
| moving a file? | Holistic | UNIX for Dummies Questions & Answers | 1 | 02-20-2003 03:47 PM |
| moving or removing a file | rooh | UNIX for Dummies Questions & Answers | 3 | 01-01-2002 10:47 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Dear Friends,
You can easily understand my problem after looking into the code. test1.sh -------- #!/bin/sh LOG_HOME="/home/vel" while [ TRUE ] do echo `date` done test2.sh -------- #!/bin/sh LOG_HOME="/home/vel" if [ -s $LOG_HOME/1.log ] then sh $LOG_HOME/test1.sh >> $LOG_HOME/1.log else touch 1.log sh $LOG_HOME/test1.sh >> $LOG_HOME/1.log fi I will execute test2.sh script. After sometime I will move the 1.log to another directory. The problem is the script is still appending the output of test1.sh to the moved file. It should not happen. 1.log should be newly created in the LOG_HOME and output should be appended to the newly created file. I have tried some logic. But I couldnt find the solution for solving this problem. Can any one help me out from this? Note: You can modify test2.sh only. Thanks in Advance, S.M.Vel |
| Forum Sponsor | ||
|
|
|
|||
|
Problem is because of inifite loop in test1.sh. It will keep on appending date informations in to 1.log. It will update the file of 1.log if you move anywhere. Operation is being done with kernel level to update a log file, we can not control from user level by changing locaiton of file.
hth. |