Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <20040417034945.7220.qmail@web12403.mail.yahoo.com> Date: Fri, 16 Apr 2004 20:49:45 -0700 (PDT) From: Christopher Spears Subject: ppd To: cygwin AT cygwin DOT com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Okay, some people have mentioned that I should explain what I am trying to do with my csh script. I think this is true. Basically, the script is called ppd.txt, and I wrote it in Notepad. ppd stands for prepend. The script will take a filename as its argument and read from standard input. Basically, it takes input from something like: 2% (date; du ~) | ./ppd.txt ~/disk_storage& The script takes the results of date and du and appends them to the beginning of a file called disk_storage. Here is the script: #!/bin/tcsh -x #csh script to prepend standard input to file argument #Version 1 #name temp file set tf = /tmp/ppd.$$ #get argument name set dest = "$argv[1]" #copy standard input, $dest to $tf cat - "$dest" > "$tf" #replace original file mv "$tf" "$dest" With help from a lot of members of this digest (thank you!), I have debugged it to the point where I do not get any error messages. However when I run the command I mentioned earlier: 2% (date; du ~) | ./ppd.txt ~/disk_storage& Nothing is prepended to disk_storage! I created disk_storage before running this script because I was getting an error message when the script could not find a file with that name. Can anyone tell me what I have done wrong? Any suggestions on writing scripts in cygwin would be appreciated, too! -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/