For working at TCL, typing SH -c and proper quote marks, too, is just
way too hard for me.
So I have a little utility verb, "U", that just takes everything after
the first word, and dispatches it.
Furthermore, if the entire line is Uppercase (the usual for TCL), then
it figures you probably meant Lowercase (the usual for Unix), so it
flips it before handing it to sh.
U PWD; LS -L
U ls -l \&SAVEDLISTS\& | grep "Nov 9"
get executed as
SH -c"pwd; ls -l"
SH -c'u ls -l \&SAVEDLISTS\& | grep "Nov 9"'
respectively.
If you insist on using all 3 (',", and \), you're on your own.
-----------------------
PROGRAM U
* Author: Charles Stevenson
* Date : Jan. 1999
* Type : General Utility verb
* Desc. : Shells to unix & executes what's on the command line.
* If entire command line is uppercase, converts everything to
* lowercase, first.
CMD = TRIMF( @SENTENCE )[' ',2,999]
IF CMD = OCONV( CMD, 'MCU' ) THEN CMD = OCONV( CMD, 'MCL' )
IF INDEX( CMD, '"', 1 ) THEN
IF INDEX( CMD, "'", 1 ) THEN
CMD = '\':CMD:'\'
END ELSE
CMD = SQUOTE( CMD )
END
END ELSE
CMD = DQUOTE( CMD )
END
EXECUTE 'SH -c':CMD
STOP
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/