1

As the question title states, I want to know what control character is used in the windows command line when we want all content within the proceeding brackets to be evaluated as the output one expects if that content were executed on a separate command line for example in Linux to assign a value to a variable:

variable=$(a valid command sequence);
Adam Ledger
  • 113
  • 7
  • ok apologies I just haven't been getting relevant search engine hits on duck – Adam Ledger Oct 10 '19 at 15:33
  • Just give me an hour to trial all 14 answers, I need the value assigned to then be concatenated with a leading string and ".txt" to form the file name that other cmd output is to be piped to, I have another program that drops an integer into a txt file that increments each time it has completed it's tasks, the bat script for which this question relates to is constantly checking that file and assigning a variable to be equal to the number it stores, ie so the text file for present log Is DNS_Cache00[the number].txt – Adam Ledger Oct 10 '19 at 15:38
  • i don't know if that elaboration on the context will be of any help or not, but i do know i am too novice to bother elaborating anymore – Adam Ledger Oct 10 '19 at 15:42
  • No it's more that due to being novice, If I elaborate any further I am concerned that will be more of a hinderance than a help do you get me? – Adam Ledger Oct 10 '19 at 17:54
  • well - generic questions tend to get generic answers (if any). Were the links in the first two comments helpful? If not - why? – Stephan Oct 10 '19 at 18:20
  • I'm pretty ocd when it comes to learning. Try to imagine you don't have years of experience and you are the type of person that randomly decides they want to learn something in as much depth as possible despite not being bothered with it for decades – Adam Ledger Oct 10 '19 at 18:25
  • naturally you would get caught up in a ton of help and man pages yes? – Adam Ledger Oct 10 '19 at 18:26
  • ok yeah it's a go thanks – Adam Ledger Oct 10 '19 at 21:38
  • ok lmfao i put a pause at the end and tried FOR /F "tokens=* USEBACKQ" %%F IN (`command`) DO ( SET var=%%F ) ECHO %var% – Adam Ledger Oct 10 '19 at 21:44
  • Did not expect the output from the spam i had dumped into file.txt – Adam Ledger Oct 10 '19 at 21:46
  • leave it ill sleep i think – Adam Ledger Oct 11 '19 at 00:00

0 Answers0