[comp.sys.apollo] Help -- this seems simple!

rich@eddie.MIT.EDU (Richard Caloggero) (04/23/88)

     Can anyone tell me why this script doesn't print anything?

----------
#!/bin/sh
set -vx
names="-name '*.c' -o -name '*t*'"
find . \( $names \) -print

----------

     It doesn't print anything!
Thanx in advance.

----- Results of running the above script ... -----
Script started on Fri Apr 22 15:40:09 1988
% 
% test.sh^U
chmod a+x test.sh
% test.sh
names="-name '*.c' -o -name '*t*'"
names=-name '*.c' -o -name '*t*'
find . \( $names \) -print
+ find . ( -name '*.c' -o -name '*t*' ) -print 

% exit
% 
script done on Fri Apr 22 15:41:02 1988



     Could you mail me the answers since I don't
read these groups.



-- 
						-- Rich (rich@eddie.mit.edu).
	The circle is open, but unbroken.
	Merry meet, merry part,
	and merry meet again.

jim@pemrac.swri.edu (James Biard) (05/02/88)

Rich,

  You may have already got this or figured it out, but I found
that you just need to add an eval to the script.
Like below:

#!/bin/sh
set -vx
names="-name '*.c' -o -name '*t*'"
eval "find . \( $names \) -print"

This clears up the problem, which seemed to be a too late sub. for names.

Hope this was helpful.

Jim Biard.