[comp.windows.x] twm: summary of replies about shell commands

harkcom@potato.pa.Yokogawa.CO.JP (Alton Harkcom) (06/12/90)

   I would like to thank everyone who replied to my call of distress...
I received many replies and have included a summary below. The request I made 
was for suggestion concerning passing quotation marks from twm to a shell
command. I admit that my request was confusing because I didn't know what I
wanted at the time.

   Most of the replies centered on passing the command without expanding it.
This is useful for the example I gave. The only suggestion that would work for
me was...

		!"find . -name '*~' -exec rm {} ';"

   This passed the command so that it would work just as if I had typed...
		find . -name "*~" -exec rm {} ;

   Another suggestion that worked was to create a shell script and call it from
twm. However, I'm trying to get rid of all of the fragmentation in the routines
I have set up. I prefer for the window manager to be able to handle all of my
dirty work instead of having a bunch of files working with the window manager
to do it.

   Some other suggestions that I couldn't get to work were...

		!"find . -name \*\~ -exec rm {} \;"
	error: find: incomplete statement
		it appears that the trailing semi-colon isn't passed, but
		then again I'm probably wrong...

		!"find . -name \\"*~\\" -exec rm {} \\;"
	error: the first backslash caused the second backslash to be passed
		and the quotation mark after the second backslash terminated
		the command. giving:  find . -name \

		!"find . -name \\*~\\ -exec rm {} \\;"
	error: the first backslash caused the second backslash to be passed
		giving: find . \*~\ -exec rm {} \


		!"find . \( -name $PAT1 -o -name $PAT2 -o \) -exec rm {} \;"
			 ^^			         ^^	        ^^
		!"find . -name $PATTERN1 -exec ..."
	error: both of the above commands have the inherant flaw of trying
		to access an environment variable which contains an *
		if the environment allows wildcards, it will be set to
		only the first occurance of the pattern.
	       The first command also contains parenthesis which give an
		error of: Badly placed ()'s

   I was happy even to get these because they taught me a lot. If someone
else can get them to work, please tell me how...


   I did find a way to pass quotation marks though...

	ex: !"echo \\\"My name is Al.\\\" said the little boy."

   The first backslash passes the second backslash and the third backslash
passes the quotation mark. I got the idea from the \\" suggestion.

--
--harkcom@potato.pa.yokogawa.co.jp