The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
a simple loop in csh dsstamps UNIX for Dummies Questions & Answers 1 05-22-2008 12:03 AM
simple for loop ali560045 Shell Programming and Scripting 3 12-16-2007 10:39 PM
Simple loop query kutz13 UNIX for Dummies Questions & Answers 2 07-17-2007 12:13 PM
Simple while loop question Brokeback Shell Programming and Scripting 3 07-21-2006 06:04 AM
a simple while loop syno Shell Programming and Scripting 5 04-08-2006 03:45 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 12-25-2007
ali560045's Avatar
Registered User
 

Join Date: Oct 2007
Posts: 265
look buddy i dint want to get int heated argument wit u.i said that u must be saying somethnig very important, so i used the word imp instead of important..........cnt u undertsand simple english also..........
Reply With Quote
Forum Sponsor
  #9  
Old 12-26-2007
rikxik's Avatar
Registered User
 

Join Date: Dec 2007
Posts: 105
Quote:
Originally Posted by ali560045 View Post
i have a script called file2

#!/bin/ksh


i=0
while [ $i -lt 5 ]
do
echo $i >> result.txt
i=`expr $i + 1`
done
echo "***********************" >> result

-------------------------------------------------------------------
Just my 2c:

@ali - you posted the above code & asked why during multiple runs, the result gets appended instead of being overwritten.

Do you know, what is the difference between ">>" & ">" is?

If you do, then no need to ask the question.
If you don't, then do "man ksh" & check the "Input/Output" section.

This forum is for helping people who are stuck somewhere. There is an assumption that you have tried on your own, did some reasonable reading of manpages etc. and still couldn't get it to work.

The question you asked is taught in page 1 of shell scripting school. It doesn't appear to me that you have even done some reading on basics of shell scripting (which is freely available in hundreds of webpages). We are more than glad to help but not to spoon-feed. If we work to help you, you also have to demonstrate that you worked yourself.

If you don't understand about something someone posts, check what you don't understand & ask "specifically" what you don't understand. Simply something like "I don't understand what you are saying" really doesn't help & irritates someone who worked to help you.

As far as language etc. is concerned, I will only say that it is better to use basic English & avoid shortcuts/abbreviations etc.

Nothing personal against you so please don't feel bad.
Reply With Quote
  #10  
Old 12-26-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Language is intended to be an aid to communication, cryptic slang/SMS abbreviations hinder this, especially in computer situations where you want to do everything to remove ambiguity, not increase it.
Reply With Quote
  #11  
Old 12-26-2007
Registered User
 

Join Date: Nov 2007
Posts: 85
use
>result.txt
In the beginning of ur scrip
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:31 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0