On Sun, 18 Dec 2005 03:28:14 -0000, Gary Smith <(E-Mail Removed)>
wrote:
>Both SET and ECHO have problems when the last line contains "<" or ">".
Too true. Other characters can cause problems as well. I doubt it is
possible to have a routine to accurately get the last line of a text
file 100% of the time with only pure batch techniques. Though Herbert
will likely provide a .com creator for this issue (which would be
welcome), 16 bit apps don't work in 64 bit machines, AFAIK.
One can quote the string to handle redirection characters, but that
technique fails if the string has quotes within it. Strings with a
single set of double-quotes in the middle along with redirection
characters are very difficult to handle, such as:
This is > a very " slippery < string.
Ampersands in the string can cause unwanted behavior, if the
sub-string that follows contains valid commands, such as:
This is a test & del *.*
VBscript/WSH may be a better way to tackle this for a built-in
solution. Tom (welcome back), Al and others discussed this recently
in another group.
http://groups.google.com/group/micro...05343ff7cadd12
Cheers,
Clay Calvert
(E-Mail Removed)
Replace "Z" with "L"