zsh-workers
 help / color / mirror / code / Atom feed
* RE: strange alias effects
       [not found] <20000529151309.A3360@br-online.de>
@ 2000-05-29 13:35 ` Andrej Borsenkow
  0 siblings, 0 replies; only message in thread
From: Andrej Borsenkow @ 2000-05-29 13:35 UTC (permalink / raw)
  To: ZSH workers mailing list, Andy Spiegl

[Redirected to zsh workers]

> > > So the problem probably starts when there are more
> aliases after the
> > > definition of bar.

No. The problem is, when alias and/or function are inside of ``if''
statement:

bor@itsrm2% cat foo
  alias psl='ps -eo user,pid,ppid,pri,pcpu,vsz,pmem,stime,time,args |
sort +1n -2 | \grep -v "stime,time"'
  alias pslS='ps -eo user,pid,ppid,pri,pcpu,vsz,pmem,stime,time,args |
sort -k 6,6n | \grep -v "stime,time"'
  look() { psl | head -1; psl | \egrep -i $@ | \grep -v egrep }
  alias lookall='psl | \egrep -v "($USER|root|bin)"'
bor@itsrm2% zsh -f
itsrm2% . ./foo
itsrm2% look
ps: unknown field name `pri'
ps: unknown field name `pri'
egrep: Usage: egrep [ -c | -l | -q ] [-insvxyhbr] -e pattern_list
                    [ -f pattern_file ] ... [file ...]
              egrep [ -c | -l | -q ] [-insvxyhbr] [ -e pattern_list ]
                      -f pattern_file ... [file ...]
              egrep [ -c | -l | -q ] [-insvxyhbr] pattern_list
                    [file ...]

but

bor@itsrm2% zsh -f
itsrm2% cat foo
if true; then
  alias psl='ps -eo user,pid,ppid,pri,pcpu,vsz,pmem,stime,time,args |
sort +1n -2 | \grep -v "stime,time"'
  alias pslS='ps -eo user,pid,ppid,pri,pcpu,vsz,pmem,stime,time,args |
sort -k 6,6n | \grep -v "stime,time"'
  look() { psl | head -1; psl | \egrep -i $@ | \grep -v egrep }
  alias lookall='psl | \egrep -v "($USER|root|bin)"'
fi
itsrm2% . ./foo
itsrm2% look
look: command not found: psl
look: command not found: psl
egrep: Usage: egrep [ -c | -l | -q ] [-insvxyhbr] -e pattern_list
                    [ -f pattern_file ] ... [file ...]
              egrep [ -c | -l | -q ] [-insvxyhbr] [ -e pattern_list ]
                      -f pattern_file ... [file ...]
              egrep [ -c | -l | -q ] [-insvxyhbr] pattern_list
                    [file ...]

This is current CVS with a couple of latest commits from Sven missing.

-andrej


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-05-29 13:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20000529151309.A3360@br-online.de>
2000-05-29 13:35 ` strange alias effects Andrej Borsenkow

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).