zsh-users
 help / color / mirror / code / Atom feed
* !!:$
@ 2004-11-16 13:45 keef
  2004-11-16 14:22 ` !!:$ Peter Stephenson
  2004-11-17  0:03 ` !!:$ Bart Schaefer
  0 siblings, 2 replies; 19+ messages in thread
From: keef @ 2004-11-16 13:45 UTC (permalink / raw)
  To: zsh-users

yarr mateys!

consider the following:

% touch somefile
% chmod 755 !!:$

 -this essentially will chmod 755 the last arg in the previous history cmd

now then, id like to incorporate this into my .zshrc

something to the effect of:
alias ch="chmod 755 !!:$"

but this produces the error:
chmod: cannot access `!!:$': No such file or directory

apparently its looking for a literal filname of "!!:$"


can anyone out there recommend a way to go about doing this ?


^ permalink raw reply	[flat|nested] 19+ messages in thread
* &&||
@ 2018-02-19 21:12 Ray Andrews
  2018-02-19 21:57 ` &&|| Peter Stephenson
  0 siblings, 1 reply; 19+ messages in thread
From: Ray Andrews @ 2018-02-19 21:12 UTC (permalink / raw)
  To: Zsh Users

function test ()
{
     _aaray=`ls`
     [ true ] && { print -l "${ _aaray[@]}" | GREP_COLOR='01;33' egrep 
--color=always "$1"\

| GREP_COLOR='01;31' egrep --color=always "$2" }\

|| echo bust!
}

    $ touch present

    $ test present pres
    present                            << two colors.

    $ test present pppres
    bust!

    $ test pppresent p
    bust!


When I first did this, I was puzzled by the output, then I wisely 
realized that the  '||'  was in fact responding to the return value of 
the failed egrep.  At first I did this without the braces and was 
content with what happened but I'd expect the braces to force the '||' 
to respond to the leading test (which of course never varies here being 
true all the time) and thus never give me a 'bust!' regardless of the 
egrep return value.  I solved the issue by using an 'if/else' 
construction but still I'm curious about the above.  Is my expectation 
mistaken?  Within an '&& ||' construction how would I write that to do 
as I was expecting -- respond to the truth value of the initial test?  
When I use braces in complex '&& ||' situations they always seem to 
behave as expected.  I do have the niggling feeling my expectation above 
is wrong, but I can't quite say why.


^ permalink raw reply	[flat|nested] 19+ messages in thread
* ??????
@ 2003-07-02 15:06 JEFF BICKLEY
  2003-07-02 19:56 ` ?????? Thorsten Haude
  0 siblings, 1 reply; 19+ messages in thread
From: JEFF BICKLEY @ 2003-07-02 15:06 UTC (permalink / raw)
  To: zsh-users

** Low Priority **

What is the zsh-users mailing list used for?


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2018-02-20 21:45 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-16 13:45 !!:$ keef
2004-11-16 14:22 ` !!:$ Peter Stephenson
2004-11-16 14:31   ` !!:$ Stephane Chazelas
2004-11-16 15:37   ` !!:$ Bart Schaefer
2004-11-16 16:08     ` !!:$ Peter Stephenson
2004-11-17  0:03 ` !!:$ Bart Schaefer
2004-11-17 19:25   ` !!:$ Danek Duvall
2004-11-18  1:10     ` !!:$ Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
2018-02-19 21:12 &&|| Ray Andrews
2018-02-19 21:57 ` &&|| Peter Stephenson
2018-02-19 22:47   ` &&|| Ray Andrews
2018-02-20  9:26     ` &&|| Peter Stephenson
2018-02-20  7:54       ` &&|| Ray Andrews
2018-02-20 17:07         ` &&|| Peter Stephenson
2018-02-20 19:24           ` &&|| Ray Andrews
2018-02-20 20:28             ` &&|| Bart Schaefer
2018-02-20 21:45               ` &&|| Ray Andrews
2003-07-02 15:06 ?????? JEFF BICKLEY
2003-07-02 19:56 ` ?????? Thorsten Haude

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