|
From: Rene R. <re...@gr...> - 2002-07-13 16:19:02
|
I've finally been able to get some useful results. This is not a perfect solution as far as I can see. Basically it involves changing the $IFS value in bash to be a newline. And changing it to the original value after use. The problem is (or will be) that filenames cannot contain newlines. I might be able to escape newlines in filenames. Anyway. This solution is better than the old one so I'm going to update the cvs with it. I'll see if I can test the newline problem and find a solution. Rene Joe zacky wrote: > Have you tried escaping single quotes like this, where $filename is the > variable containing the name of the file: > \'$filename\' > > Joe > > Rene Rask wrote: > >>The names are quoted. I've tried both double and single quoting. >>If I can get bash to accept the names as "literal" instead of "glob" it >>should solve the problem. >> >>A name like "some name^Mtest" does not behave well. >>Only working solution I've found was this way: >>$'some name^Mtest' >>But I can't figure out how that is useful in a script. >> >> >>I'll keep trying. >> >>-Rene >> >> >>On Fri, 2002-07-12 at 07:26, Joe zacky wrote: >> >> >>>Rene Rask wrote: >>> >>> >>> >>>>I've been looking into the filename problems. >>>> >>>>It seems to me that escaping filenames in PHP will ony lead to a >>>>constant headache (which is not what I need right now ;) >>>> >>>>I've found a few Bash tricks that look really promising but I haven't >>>>cracked the problem yet. I'm able to make Bash escape a filename with >>>>weird characters in it. But I'm still not able to do it with input >>>>from a list. >>>>When (if?) I get this working we should be able to stop worrying about >>>>filenames. >>>>If you know any Bash experts please ask if they can help. >>>> >>>>-Rene >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>This sf.net email is sponsored by:ThinkGeek >>>>Two, two, TWO treats in one. >>>>http://thinkgeek.com/sf >>>>_______________________________________________ >>>>Bobs-devel mailing list >>>>Bob...@li... >>>>https://lists.sourceforge.net/lists/listinfo/bobs-devel >>>> >>>> >>>> >>>Have you tried "quoting the filenames?" That also works in bash. >>> >>> >>> >>>------------------------------------------------------- >>>This sf.net email is sponsored by:ThinkGeek >>>Gadgets, caffeine, t-shirts, fun stuff. >>>http://thinkgeek.com/sf >>>_______________________________________________ >>>Bobs-devel mailing list >>>Bob...@li... >>>https://lists.sourceforge.net/lists/listinfo/bobs-devel >>> >>> >> >> >> >> >>------------------------------------------------------- >>This sf.net email is sponsored by:ThinkGeek >>Gadgets, caffeine, t-shirts, fun stuff. >>http://thinkgeek.com/sf >>_______________________________________________ >>Bobs-devel mailing list >>Bob...@li... >>https://lists.sourceforge.net/lists/listinfo/bobs-devel >> >> >> > |