parsing issue in command GLOBAL

May 31, 2008
382
2
It appears that the parser doesn't like when it finds a variable between GLOBAL and its command (in batch files and command lines):
Code:
V:\...\TCC>ver

TCC  13.00.27   Windows XP [Version 5.1.2600]

V:\...\TCC>set x=/Q

V:\...\TCC>global %x echo %_cwd

GLOBAL: V:\bin\totalcmd\util\TCC
TCC: Unknown command "/Q"

V:\...\TCC>global /Q echo %_cwd
V:\bin\TCC
 
May 20, 2008
11,400
99
Syracuse, NY, USA
I imagine that global does not want to screw up the command so it doesn't do
variable expansion ... just looks for switches and saves the rest to be expanded
and executed later. Since the command itself seems more likely to start with a
variable (than options being in a variable) I imagine allowing options in a
variable would be pretty hard to do (and of little value).

On Tue, 25 Oct 2011 10:17:26 -0400, Stefano Piccardi <>
wrote:

|It appears that the parser doesn't like when it finds a variable between GLOBAL and its command (in batch files and command lines):
|
|Code:
|---------
|V:\...\TCC>ver
|
|TCC 13.00.27 Windows XP [Version 5.1.2600]
|
|V:\...\TCC>set x=/Q
|
|V:\...\TCC>global %x echo %_cwd
|
|GLOBAL: V:\bin\totalcmd\util\TCC
|TCC: Unknown command "/Q"
|
|V:\...\TCC>global /Q echo %_cwd
|V:\bin\TCC
|---------
 
May 20, 2008
3,515
4
Elkridge, MD, USA
From: Stefano Piccardi
| It appears that the parser doesn't like when it finds a variable
| between GLOBAL and its command (in batch files and command lines):
|
| Code:
| V:\...\TCC>ver
|
| TCC 13.00.27 Windows XP [Version 5.1.2600]
|
| V:\...\TCC>set x=/Q
|
| V:\...\TCC>global %x echo %_cwd
|
| GLOBAL: V:\bin\totalcmd\util\TCC
| TCC: Unknown command "/Q"
|
| V:\...\TCC>global /Q echo %_cwd V:\bin\TCC

Verified. This artifact of parsing has existed even in V7...

This does not work either: set x to either GLOBAL or GLOBAL/Q as needed, and use %x as the global command. Also fails: alias g=`global %x`.

Suggest you use an alias with its value set to either GLOBAL or to GLOBAL /Q as needed; which does work.
--
HTH, Steve
 
Similar threads
Thread starter Title Forum Replies Date
S New "home" variable parsing issue Support 1
D Parsing an array variable to an array does not work Support 5
vefatica IF, @WMI, parsing? Support 7
M Command line parsing differences between cmd.exe and TCC Support 6
nickles Command name parsing of GNU compilers Support 13
J Python: TCC command line parsing removes '=' equal sign characters Support 4
H command line parsing question Support 5
cgunhouse One of the Focuses of V17 Beta Testing Should Be Command Line Parsing Support 1
M How to? Parsing lines containing double quotes... Support 3
C CMD if parsing Support 2
M A probably stupid question about .btm file argument parsing... Support 6
samintz Help with some parsing Support 6
vefatica Parsing error! Support 9
nikbackm Parsing problem? (IFF, "", &) Support 0
cgunhouse TCToolBar /W Issue Support 1
G v28 Display Issue Support 7
Jay Sage Issue with CD_ENTER Alias Support 37
Jay Sage Issue with CD_LEAVE Alias Support 3
fpefpe How to? issue with % and evaluation Support 5
cgunhouse Standard User Account Issue Support 2
samintz WAD Display wrapping issue Support 5
M TCC color issue in ConEmu Support 4
samintz Timer issue Support 4
Alpengreis Documentation Minor issue in help file for view /E Support 1
samintz WAD ANSI issue Support 3
D TCSTART issue after reinstallation Support 14
A Documentation [Help file] OPTION "//" synopsis formatting issue Support 0
Chen Touboul Overtyping issue - i press the Insert key, help till press enter for new line in TCC Support 2
Y TCC and Cmder imcompatibility issue Support 7
M Another possibly strange remote registry issue Support 5
T WAD bpokestr issue Support 5
D High-DPI Scaling issue Support 1
S CMDebug 22 issue with del command Support 1
cgunhouse Foldermonitor Issue Support 7
samintz Build 38 Install issue Support 5
rps WAD Setlocal issue Support 4
Luiz Rodrigues Issue with Maven Support 1
Seven Update / install issue with 20.0.20.10.32 take command Support 7
Fross WebDav Drive Mapping Issue Support 19
D Upgrade issue Support 3
Fross V20b8 Everything Issue Support 5
T TCC display issue Support 1
cgunhouse _logfile Issue Support 5
T Fixed Querybox issue Support 1
cgunhouse Fixed Share Memory Issue Support 5
cgunhouse Foldermonitor with "/E" Option Issue Support 6
Fross TabComplete Argument Issue Support 1
fpefpe How to? Stange start up issue Support 1
C cosmetic issue with LIST's (I) Support 9
jbarnes1967 TC 18.00 x64 issue with lua io.popen() Support 2

Similar threads