Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: using brackets in scripts



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



Messages sorted by: Reverse Date, Date, Thread, Author