X-Spam-Check-By: sourceware.org From: Vidiot Message-Id: <200605260529.k4Q5TUX23890@mrvideo.vidiot.com> Subject: sh script works, zsh script doesn't To: cygwin AT cygwin DOT com Date: Fri, 26 May 2006 00:29:29 -0500 (CDT) X-Mailer: ELM [version 2.5 PL3] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 At the end of this e-mail is the script that I am attempting to run. As it is current written, the tsreader program will start and run, IFF the $LOG file is told to run. As can be seen, it is built as a SHell script. If I comment out the ling that start $LOG and uncomment the line at the very end, tsreader is started, but it complains about not receiving what it is expecting for the tsreader_twinhan1030.dll source. The items it complains about are the last 5 values. Yet, as can be seen, that same command line is placed into the shell-script file and it works from there. Starting directly from the Z-shell file results in an error. I run the script from cron, which doesn't allow me to see the error GUI. When I run the crontan line by hand, then I see the tsreader error GUI. I've asked the author of tsreader if there is an option I can do that will create a log file with what it "sees" on the command line for options. I just sent that off before this e-mail. But, if anyone has a clue as to why starting of a Windblows program from a Z-shell doesn't work, yet from a shell-script, it does, I'd certainly appreciate knowing. Thanks. MB -- e-mail: vidiot AT vidiot DOT com /~\ The ASCII \ / Ribbon Campaign [So it's true, scythe matters. Willow 5/12/03] X Against Visit - URL: http://vidiot.com/ / \ HTML Email #!/usr/bin/zsh # # TSReader batch file for universal capture - called from cron # # The capture options are placed on the command line, and consists of: # # -c set C-band LO frequency (default) # -d destination drive letter, i.e., c, d, e, f or g (:\ added) # -f filename # -k set Ku-band LO frequency # -l length of capture, in hh:mm:ss # (hh, mm or ss can be single digits) - but all must be there # -m mux program stream ID to capture # if set to zero, the complete mux is captured (default = 0) # -r downlink frequency # -s symbolrate # # default variables DATE=`date +%y%m%d-%H%M` DRIVE=E ERROR=0 FILENAME=TSReader-DVB FREQ="" LENGTH="" LOG=/tmp/Timer-TSReader.log.$$ LOFREQ=5150 MUX="-a 0" PATH=${PATH}:/cygdrive/c/Program\ Files/COOL.STF/TSReader SYMB="" while getopts cd:f:kl:m:r:s: OPT do case "$OPT" in (c) LOFREQ=5150 ;; (d) DRIVE=$OPTARG ;; (f) FILENAME=$OPTARG ;; (k) LOFREQ=10750 ;; (l) LENGTH=$OPTARG ;; (m) if [[ $OPTARG -ge 1 ]] then; MUX="-r $OPTARG" fi ;; (r) FREQ=$OPTARG ;; (s) SYMB=$OPTARG ;; esac done if [[ $LENGTH = "" ]] then; ERROR=1 echo "No length given (-l)" >> $LOG fi if [[ $FREQ = "" ]] then; ERROR=1 echo "No sat frequency given (-r)" >> $LOG fi if [[ $SYMB = "" ]] then; ERROR=1 echo "No symbol rate given (-s)" >> $LOG fi if [[ $ERROR -eq 1 ]] then; echo "" >> $LOG echo "One too many errors, giving up." >> $LOG exit 1 fi # convert human length into TSReader seconds HH=`echo $LENGTH | cut -d: -f1` MM=`echo $LENGTH | cut -d: -f2` SS=`echo $LENGTH | cut -d: -f3` LENGTH=$(( $HH * 3600 + $MM * 60 + $SS )) echo "#!/bin/sh" > $LOG echo "#Starting TSReader at $DATE" >> $LOG echo "tsreader -1 -d -i -s tsreader_twinhan1030.dll $MUX \ ${DRIVE}:\\${FILENAME}-${DATE}.ts $LENGTH \ $FREQ 0 $SYMB $LOFREQ 0" >> $LOG chmod 775 $LOG $LOG #tsreader -1 -d -i -s tsreader_twinhan1030.dll $MUX ${DRIVE}:\\${FILENAME}-${DATE}.ts $LENGTH $FREQ 0 $SYMB $LOFREQ 0 -- 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/