From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12747 invoked from network); 23 Jul 2006 10:38:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 23 Jul 2006 10:38:41 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 33287 invoked from network); 23 Jul 2006 10:38:33 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 23 Jul 2006 10:38:33 -0000 Received: (qmail 20601 invoked by alias); 23 Jul 2006 10:38:24 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10538 Received: (qmail 20591 invoked from network); 23 Jul 2006 10:38:24 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 23 Jul 2006 10:38:24 -0000 Received: (qmail 32058 invoked from network); 23 Jul 2006 10:38:24 -0000 Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by a.mx.sunsite.dk with SMTP; 23 Jul 2006 10:38:20 -0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1G4bLl-0000Tl-4X for zsh-users@sunsite.dk; Sun, 23 Jul 2006 12:38:17 +0200 Received: from 241.119-84-212.staticip.namesco.net ([212.84.119.241]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 23 Jul 2006 12:38:17 +0200 Received: from david by 241.119-84-212.staticip.namesco.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 23 Jul 2006 12:38:17 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@sunsite.dk From: zzapper Subject: Re: Output not being echo'd in shell scripts. Date: Sun, 23 Jul 2006 10:38:11 +0000 (UTC) Organization: SuccessTheory Message-ID: References: <96c45c490607162152k4d7d81b8x5d143c7b5c51d585@mail.gmail.com> X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 241.119-84-212.staticip.namesco.net User-Agent: Xnews/5.04.25 Sender: news Sean wrote in news:96c45c490607162152k4d7d81b8x5d143c7b5c51d585@mail.gmail.com: > I am having problems running a simple shell script: todo.sh > [todotxt.com] > > I am running the windows port of zsh (ver 3.0.5) supplied with > unixkit-tiny. > > The problem is simply that commands that work when entered directly at > the prompt do not seem to work when run in a shell script. > > I have tested the script by running each line in the shell and I > believe the problem is related to the echo command. > > For instance, the command: > > "todo.sh list" should list all items in the todo.txt file but instead > returns this: > > -- > TODO: tasks in /unixkit/todo/todo.txt. > > > If I execute the appropriate commands directly in the shell like this: > > echo -e "`sed = "/unixkit/todo/todo.txt" | sed 'N; s/^/ /; s/ > *\(.\{2,\}\)\n/\1 /' | sed 's/^ /0/' | sort -k2 | sed > 's/\(.*(A).*\)/'$PRI_A'\1'$DEFAULT'/g' | sed > 's/\(.*(B).*\)/'$PRI_B'\1'$'/g' | sed 's/\(.*(C).* \)/'$PRI_C'\1'$'/g' >| sed 's/\(.*([A-Z]).*\)/'$PRI_X'\1'$DEFAULT'/g'`" > > I get the appropriate result: > > 01 Compile list of items to sell p:garage_cleanup @home > > If I add -x to the shebang, I get the following: > ____ > > + action=list > + item= > + '[' -z '' ']' > ++ sed = /unixkit/todo/todo.txt > ++ sed 'N; s/^/ /; s/ *\(.\{2,\}\)\n/\1 /' > ++ sed 's/^ /0/' > ++ sort -k2 > ++ sed 's/\(.*(A).*\)/\\033[1;33m\1\\033[0m/g' > ++ sed 's/\(.*(B).*\)/\\033[0;32m\1/g' > ++ sed 's/\(.*(C).* \)/\\033[1;34m\1/g' > ++ sed 's/\(.*([A-Z]).*\)/\\033[1;37m\1\\033[0m/g' > + echo -e '' > > + echo -- > -- > ++ wc -l /unixkit/todo/todo.txt > ++ sed 's/^[[:space:]]*\([0-9]*\).*/\1/' > + NUMTASKS= > + echo 'TODO: tasks in /unixkit/todo/todo.txt.' > TODO: tasks in /unixkit/todo/todo.txt. > + cleanup > + '[' -f /unixkit/todo/todo.tmp ']' > + rm /unixkit/todo/todo.tmp > + exit 0 > ____ > > Anyway, I was hoping that it is somthing simple that I am doing wrong > / need to configure in the zsh environment. > > TIA > > Sean > > Hi Sean I don't know if the following is relevant to your problem:- Do you have the following option set? setopt no_prompt_cr #needed for perl scripts This is an old zsh chestnut where zsh does not output if there is no trailing CRHTH -- http://successtheory.com/tips/ Vim, Zsh, MySQL Tips