On 8/23/06, Martin Baehr <[EMAIL PROTECTED]> wrote:
> On Wed, Aug 23, 2006 at 01:17:20PM -0400, Philip Ganchev wrote:
> > I guess the only reason a builtin may be less discoverable than a
> > variable is that there are much fewer variables (and that other shells
> > use a variable).
>
> are you talking about history?
> in bash it's a builtin.
Reading the bash documentation, it seems that the history builtin in
bash doesn't really do anything that isn't easily done either using
array splicing or a simple pipeline. But it makes a lot of sense to be
Posix compatible whenever the alternative isn't significantly better.
Maybe that is the way to go. If the (foo)[2 4] syntax doen't seem to
have any side issues, then I guess there aren't really any advantages
for $history other than slightly less code to implement it.
>
> > > * Fish uses a 'random' builtin instead of a $RANDOM varaible as bash
> > > does, because it really is more a function than a variable
>
> yup, i agree, it's a lot better that way.
>
> > > * $history allows you to do neat things like array slicing because it
> > > is an array and fish has some pretty nice tools for manipulating
> > > arrays.
>
> is there a way to search for strings, wildcards or regular expressions?
Lots of them. grep. expr. sed. ;-)
All history items where grep is called but not less:
printf "%s\n" $history|grep sed|grep -v less
It would be really easy to provide this type of functionality built
into fish through some magical ([{\{REGEX\}}]) syntax, like e.g. bash
does, but what would be the point? Save maybe three key strokes, and
lose the consistency and small size of the language.
>
> > Of course, it would be nicer if ``(history)[2 4]`` worked.
>
> that would be really neat...
>
> btw: quote from a friend who likes lisp a lot:
> fish and SBCL with linedit running side-by-side...
> I'm in tab-completion heaven
> (SBCL is steel banks common lisp)
Yay! :-)
Does that mean I will be getting a completion file for SBCL?
>
> greetings, martin.
> --
> cooperative communication with sTeam - caudium, pike, roxen and unix
> offering: programming, training and administration - anywhere in the world
> --
> pike programmer travelling and working in europe open-steam.org
> unix system- bahai.or.at iaeste.(tuwien.ac|or).at
> administrator (caudium|gotpike).org is.schon.org
> Martin Bähr http://www.iaeste.or.at/~mbaehr/
--
Axel
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users