On 9/3/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote: > 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.
This is a shellscript implementation of isatty. It relies on the 'tty' command, whose exit status should depend on wether stdin is a tty. Not sure how portable this is, but FreeBSD has a tty implementation. Will look into that later. The optional argument should be the tty to test, so 'isatty 1' should test stdout. function isatty set -l fd 0 count $argv >/dev/null ; and set fd $argv eval "tty 0>&$fd >/dev/null"; and return 0 return 1 end This might go into an upcoming fish version. We'll see. > > > > > > > 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 > -- 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
