zsh-workers
 help / color / mirror / code / Atom feed
From: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>
To: "ZSH workers mailing list" <zsh-workers@sunsite.auc.dk>,
	"Andy Spiegl" <zsh.Andy@spiegl.de>
Subject: RE: strange alias effects
Date: Mon, 29 May 2000 17:35:47 +0400	[thread overview]
Message-ID: <000601bfc972$cc0d9480$21c9ca95@mow.siemens.ru> (raw)
In-Reply-To: <20000529151309.A3360@br-online.de>

[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


           reply	other threads:[~2000-05-29 13:36 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20000529151309.A3360@br-online.de>]

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='000601bfc972$cc0d9480$21c9ca95@mow.siemens.ru' \
    --to=andrej.borsenkow@mow.siemens.ru \
    --cc=zsh-workers@sunsite.auc.dk \
    --cc=zsh.Andy@spiegl.de \
    /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).