Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: sourcing of /etc/profile with $0 == -sh
- X-seq: zsh-workers 4049
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: Peter Stephenson <pws@xxxxxx>, zsh-workers@xxxxxxxxxxxxxxx (Zsh hackers list)
- Subject: Re: sourcing of /etc/profile with $0 == -sh
- Date: Fri, 5 Jun 1998 01:22:21 -0700
- Cc: "Andrej Borsenkow" <borsenkow.msk@xxxxxx>
- In-reply-to: <199806050739.JAA27113@xxxxxxxxxxxx>
- References: <199806050739.JAA27113@xxxxxxxxxxxx>
On Jun 5, 9:39am, Peter Stephenson wrote:
} Subject: Re: sourcing of /etc/profile with $0 == -sh
}
} % fn() { 0=foo; echo $0; }
} % fn
} foo
} % echo $0
} zsh
}
} This fact should probably be construed as a genuine feature. If you're
} asking, is some bright spark going to decide that $0 should be different
} from $1 to $infinity and break it, I can't answer that, but it won't be me.
Actually, Peter, you're already too late. That had better be
fn() {
setopt functionargzero
0=foo
echo $0
}
Otherwise, assigning to 0 in the function assigns to the "global" $0.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author