home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 67,966 of 68,980   
   R.Wieser to All   
   Re: echo a variable containing an & some   
   20 Nov 22 15:35:10   
   
   From: address@not.available   
      
   JJ,   
      
   > AFAIK, FOR variables are expanded *after* the command line   
   > has been parsed. ... normal variables in the command line   
   > are expanded *before* the command line is parsed.   
      
   That was my conclusion too.   But I see that my question was imprecise.  The   
   "why" was aimed more at "why does it happen in two different ways".   
      
   Though I just now remembered having recently read that the batch scripting   
   language has evolved over time, and with evolution lots of weird things can   
   happen.   
      
   > DelayedExpansion can be used, but escape character may need   
   > to be specified twice when it's needed. Adding complexity for   
   > normal variables usage. It may cause a problem which is unsolvable   
   > instead.   
      
   Argh!   
      
   > For non-DelayedExpansion normal variables, we'd have to use FOR   
   > variable to display it. e.g.   
      
   :-) Yep, as I included in my initial post (the "but doesn't when done   
   indirectly" example).   
      
   Regards,   
   Rudy Wieser   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca