From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11212 invoked from network); 29 Mar 2009 11:40:39 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 29 Mar 2009 11:40:39 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 89709 invoked from network); 29 Mar 2009 11:40:30 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 29 Mar 2009 11:40:30 -0000 Received: (qmail 11543 invoked by alias); 29 Mar 2009 11:40:16 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13989 Received: (qmail 11534 invoked from network); 29 Mar 2009 11:40:15 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 29 Mar 2009 11:40:15 -0000 Received: from atom.smasher.org (atom.smasher.org [69.55.237.145]) by bifrost.dotsrc.org (Postfix) with SMTP id 3F6FD8026E28 for ; Sun, 29 Mar 2009 13:40:01 +0200 (CEST) Received: (qmail 49734 invoked by uid 1000); 29 Mar 2009 11:39:59 -0000 Message-ID: <20090329113959.49732.qmail@smasher.org> cc: zsh-users@sunsite.dk Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Date: Mon, 30 Mar 2009 00:39:59 +1300 (NZDT) From: Atom Smasher In-Reply-To: MIME-Version: 1.0 OpenPGP: id=0xB88D52E4D9F57808; algo=1 (RSA); size=4096; url=http://atom.smasher.org/pgp.txt References: <200903291445.32918.arvidjaar@gmail.com> Subject: Re: using brackets in scripts To: Pol X-POM: The Moon is Waxing Crescent (10% of Full) X-Hashcash: 1:20:0903291140:xtekhne@gmail.com::TSr0DT6fohOc5fT7:0000000000000000 0000000000000000000000003ONy X-Hashcash: 1:20:0903291140:zsh-users@sunsite.dk::PzgxZ7ZtVll5nLvp:0000000000000 000000000000000000000000DpPf X-Virus-Scanned: ClamAV 0.92.1/9178/Sun Mar 29 04:52:31 2009 on bifrost X-Virus-Status: Clean On Sun, 29 Mar 2009, Pol wrote: > My script starts with > #!/bin/zsh > > but then commands are preceded by 'sudo' > > Same result if commands in script are not preceded by 'sudo', but the > script itself is launched by 'sudo' . ================= within the script, run the commands "zmodload", "setopt" and "autoload -U zargs", and see if you get output that makes sense in a zsh environment. if not, the commands within your script are not being executed by zsh. also, on your command line, check the path to zsh: ls -lh =zsh it might be in /usr/local/bin/zsh, which might cause the script to default to a bourne shell, and the zsh glob tricks will fail. if the commands are preceded by sudo, try: sudo zsh -c ls -l save/*(.) or, try setting "SHELL=zsh" towards the top of the script, before invoking sudo. -- ...atom ________________________ http://atom.smasher.org/ 762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808 ------------------------------------------------- "They tell us that we live in a great free republic; that our institutions are democratic; that we are a free and self-governing people. That is too much, even for a joke. Wars throughout history have been waged for conquest and plunder. And that is war in a nutshell. The master class has always declared the wars; the subject class has always fought the battles." -- Eugene V. Debs, 1918