Newsgroups: comp.sys.mac.programmer Path: utzoo!censor!geac!alias!barney!rae From: Reid Ellis Subject: Re: MPW & spaces in pathnames Message-ID: Sender: Reid Ellis Reply-To: Reid Ellis Organization: Alias Research, Inc. Toronto ON Canada References: <1990Dec27.173958.18413@CAM.ORG> <1990Dec29.221358.18317@chinet.chi.il.us> <14457@hoptoad.uucp> Date: 5 Jan 91 20:20:49 GMT Laird J. Heal writes: >Wherever there is a file name, put double-quotes around anything that >is not wild-carded (? or option-x) and almost all of your troubles >will be solved. Tim Maroney writes: >Building file names out of arguments and variable expansions, and >storing them in variables or aliases, makes the problem much more >complicated. One problem along these lines is storing filenames in a file, separated by newlines. Given such a file, it is difficult to assign the file names to a variable, properly quoted. That is to say, given a file such as: File Number 1 Second File I want to set a variable as follows: set foo '"File Number 1" "Second File"' The obvious doesn't work: set foo "`cat filename`" since files have spaces in them. Later in the script, I want to be able to say: for file in {foo} ... Recently, I have started using StreamEdit as a solution to the problem, be having it quote each line in the file. Thus my assignment is now: set foo `streamedit -s script.sed file` Not quite good enough, in my view. Reid -- Reid Ellis 176 Brookbanks Drive, Toronto ON, M3A 2T5 Canada rae@gpu.utcs.toronto.edu || rae%alias@csri.toronto.edu CDA0610@applelink.apple.com || +1 416 446 1644