Am Donnerstag, 25. Januar 2007 23:47 schrieb James G. Sack (jim): > John H. Robinson, IV wrote: > > Dexter Filmore wrote: > >> Well, shouldn't \ do th job as well? > >> Thing is, even if I pass the filename > >> foo\ bar > >> echo tells me the name is > >> foo bar > > > > echo is a bad tool to use to determine where the shell is breaking the > > words. > > > > compare: > > > > a="moo cow" > > echo \""$a"\" > > echo \"$a\" > > > > They both provide the same results, but one is split and the other is > > not. > > > > This is why I offered you ls -b. You can also use test -f. > > > > sh-3.1$ touch "moo cow" > > sh-3.1$ a=moo\ cow > > sh-3.1$ test -f $a > > sh: test: moo: binary operator expected > > sh-3.1$ test -f "$a" > > > > $a got split, and "$a" remained as a single word. You can also play with > > set. > > > > sh-3.1$ a="moo cow"; set - $a; echo $#; set - "$a" ; echo $# > > 2 > > 1 > > > > > > Stop trying to count the number of arguments with echo: it does not > > work. > > The last sentence is right-on! > > I provided a script that can be used instead of echo, that has helped me > with this issue. I guess I didn't explain very well what it's purpose > was or how to use it.
Yes, that was the missing info :) I'll run some tests, thanks. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.12 GCS d--(+)@ s-:+ a- C++++ UL++ P+>++ L+++>++++ E-- W++ N o? K- w--(---) !O M+ V- PS+ PE Y++ PGP t++(---)@ 5 X+(++) R+(++) tv--(+)@ b++(+++) DI+++ D- G++ e* h>++ r* y? ------END GEEK CODE BLOCK------ http://www.stop1984.com http://www.againsttcpa.com -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
