On 8/23/06, Martin Baehr <[EMAIL PROTECTED]> wrote:
> On Wed, Aug 23, 2006 at 06:20:50PM -0400, Philip Ganchev wrote:
> > > > > * $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?
> > Um... use "grep".
>
> that would not count as pretty nice tool for manipulating arrays
>
>   for i in history; echo $i; end | grep foo
>
> is not really useful.
> i'd have to do something like this:
>
>   set found (for i in $history;
>                echo $i;
>              end | grep -n foo | awk -F: '{ print $1 }')
>
> to get the matching indices, which would be necessary to manipulate the
> history. that seems rather awkward...

To get matching entries, you can write

    printf "%s\n" $history | grep foo

and to get the indices

    printf "%s\n" $history | grep -n foo | cut -f 1 -d :

True, it can be shorter if there was a special-purpose string matcher,
but don't you think this would be bloat?

It would be neater if the commands operated with objects instead of
strings, and iPython does something like that.

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

Reply via email to