delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/28/03:01:23

Message-ID: <3959A07F.FB5A37A6@uclink4.berkeley.edu>
From: Phil Robyn <probyn AT uclink4 DOT berkeley DOT edu>
Organization: Univ. of California, Berkeley
X-Mailer: Mozilla 4.73 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.misc,comp.os.msdos.djgpp
Subject: Re: to pipe system variables other variables at command line
References: <3957018F DOT 35C44125 AT gmx DOT de DOT de>
Lines: 20
Date: Wed, 28 Jun 2000 06:51:44 GMT
NNTP-Posting-Host: 12.72.0.139
X-Complaints-To: abuse AT worldnet DOT att DOT net
X-Trace: bgtnsc06-news.ops.worldnet.att.net 962175104 12.72.0.139 (Wed, 28 Jun 2000 06:51:44 GMT)
NNTP-Posting-Date: Wed, 28 Jun 2000 06:51:44 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Stephan Rink wrote:

> I like to pipe a system variables to another variable at a MS DOS shell
> without using a file.
> At the command line it should look like this
>
> C:> var1 < date /t                                // this will cause an
> error
> C:> copy name.txt name%var1.txt
> or
> C:> set var1= | date /t                         // this will show only
> the date
> C:> copy name.txt name%var1.txt
>
> How can I submit the output of a command to a Variable?
>
> Stephan

for /f "tokens=*" %a in ('date /t') do set zdate=%a

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019