On Thu, Aug 17, 2006 at 02:09:59PM +0200, Axel Liljencrantz wrote:
> You are correct that [] and {} are not identical, but fish does not
> have both because they are so strongly related, just as Jamessan said.
i never saw them as related, but ok.
> I have found that in all such situations I have encountered in the
> real world, it has been easy to sneak in a ?-wildcard somewhere in a
> safe manner to only get the files that really exist.
hmm, i can't think of a way how to do that in the examples i gave.
could you try and show how you'd do that?
> If so, I would suggest the inclusion of a null-wildcard-operator, one
> that does not match any output, but all non-existing paths are
> dropped.
sounds interresting...
> The idea here would be to instead of having two nearly-identical
> features, like {} and [], to have two unrelated features that together
> do all the things you could do previously and many that were very
> cumbersome before as well.
indeed. and i can see some nice additional uses already,
because [] only operated on single chars, while {,} works on strings
> Another thing worth considering is how often you'd want to use this
> null-wildcard.
very often.
more often if it were easier to use.
my most common need is to cover a range of numbered files.
so a really nice feature would be to write something like:
ls foo{12..55}.ext
and have that expand to all values between,
but now reduced to the files actually existing.
hmm, actually foo(seq 12 55).ext does the expanding part already.
it is amazing, for every problem in fish i find a few new great
features. so on the competition of bash vs fish, so far, fish is
winning. (and that means a lot, considering that i use unix since 1992)
> Only things that are common enough that writing it out as a command
> would be cumbersome should be made into operators of the language
> itself.
agreed.
> function isfile
> for i in $argv
> test -f $i; and echo $i
> end
> end
adding a function on the commandline only seems to work if it is on
one line. being able to just paste the code into the shell would be
nice.
> touch (isfile foo{1,2,3})
> the former is admittedly much longer/uglier, but if this is done very
> rarely, that should be offset by the fact that it is easier to learn a
> small language, that it is easier to find out what the code does if it
> contains only functions and commands instead of weird operators, etc..
very true.
i'll play around with the function and see how far it gets me.
is there a way to make it throw an error if the list is empty?
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/
-------------------------------------------------------------------------
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