RE: Réf. : [cvsnt] Re: administrative files: I will get mad

Michael Wojcik Michael.Wojcik at microfocus.com
Thu Jan 19 14:12:06 GMT 2006


> From: cvsnt-bounces at cvsnt.org 
> [mailto:cvsnt-bounces at cvsnt.org] On Behalf Of feymard at stago.fr
> Sent: Thursday, 19 January, 2006 05:34
> 
> for exit: I just read the help command. That's ok now, thanks :)
> For .%1.: this is not the solution. The manual tells that 
> comments are on
> stdin, and not used as an argument of the script called by 
> verifymsg...

If you're using XP or later, and you need to get input from stdin in a command file, use "set /p".  For example:

	@echo off
	setlocal enableextensions
	set /p line=
	echo you entered "%line%"
	if "%line%" == "" echo empty string entered

Save that as "testinput.cmd", then try it with various combinations of input.  Enter (or redirect, or pipe) a non-empty line, and it will echo it; run it and just hit enter (or redirect a zero-length file into it, etc) and it will tell you an empty string was entered.

"help set" will give you the full documentation, but that's really all there is to it.  (And incidentally, if you're using NT or later, you should use .cmd as the extention for script files running under cmd.exe.  There are very few differences in the processing of .bat and .cmd in recent versions of cmd.exe, but .cmd is current and .bat only retained for compatibility.  Also, .cmd tells people that it's intended for cmd.exe.)

-- 
Michael Wojcik
Principal Software Systems Developer, Micro Focus




More information about the cvsnt mailing list