zsh-users
 help / color / mirror / code / Atom feed
From: Atom Smasher <atom@smasher.org>
To: Pol <xtekhne@gmail.com>
Cc: zsh-users@sunsite.dk
Subject: Re: using brackets in scripts
Date: Mon, 30 Mar 2009 00:39:59 +1300 (NZDT)	[thread overview]
Message-ID: <20090329113959.49732.qmail@smasher.org> (raw)
In-Reply-To: <gqnltq$c4f$1@ger.gmane.org>

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


  reply	other threads:[~2009-03-29 11:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-29  9:29 Pol
2009-03-29 10:43 ` Frank Terbeck
2009-03-29 10:45 ` Andrey Borzenkov
2009-03-29 11:08   ` Pol
2009-03-29 11:39     ` Atom Smasher [this message]
2009-03-29 15:12       ` Pol
2009-03-30 10:42         ` zzapper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090329113959.49732.qmail@smasher.org \
    --to=atom@smasher.org \
    --cc=xtekhne@gmail.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).