On 9/2/06, Martin Baehr <[EMAIL PROTECTED]> wrote: > hi, > > this one left me puzzeled for quite a while: > > i was doing something along the lines of: > > ls foo/*/(ls bar) > > and i kept getting: > fish: Warning: No match for wildcard "foo/*/(ls bar)". The command will not be > executed. > ls foo/*/(ls bar) > ^ > which made no sense because on manual inspection the files were there. > then i tried: > > > for i in (ls bar); ls foo/*/$i; end > fish: Warning: No match for wildcard #foo/*/$i#. The command will not be > executed. > for i in (ls bar); ls foo/*/$i; end > ^ > > ls bar > bar* baz* gazong* > > ls foo/*/* > foo/ba/bar* foo/ba/baz* foo/ba/gazong* foo/fo/a* foo/fo/b* foo/fo/c* > > files are there, so why where they not found? > this took me some time to figure out. > > in the end i discovered: > > ls bar/ | less > bar* > baz* > gazong* > > why are there *s behind the files in the pipe? > of course fish can't find files that end with "*" > > > functions ls > function ls --description List\ contents\ of\ directory > command ls --color=auto --indicator-style=classify $argv > end > > that's the bug: > removing --indicator-style=classify solved the problem. > > > but i love classify, i don't want to remove it. > > this leads to the question: > how can a function detect if it is being used in a pipe?
Ouch, that needs to be fixed. I though ls was clever enough to autodetect these things. Thank you for the report. There is a C function called isatty that tests if a file descriptor is a tty. I'll try to find a commandline program that does the same thing. If one doesn't exist, I guess it should be written. > > > interrestingly, after creating a fixed copy of the function in my users > directory i discovered this: > > ls bar > bar* baz* gazong* > > ls bar > bar baz gazong > > functions ls > function ls --description List\ contents\ of\ directory > command ls --color=auto $argv > end > > > functions ls > function ls --description List\ contents\ of\ directory > command ls --color=auto --indicator-style=classify $argv > end > > it seems that fish is getting randomly confused about which function to use... Much like Philip, I can't reproduce this from the description given above. Can you give me a series of steps to follow to get this behaviour? > > 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
