----^--->
/\

//\\
//The\
/Sy
stem\
////
Guard
\

In the mount of the LORD it shall be seen. Genesis 22:14

Show

Booming Or Fuming? | MasterCatalog | ntlib (FREE) | NTCmdLib | MtCmds | Scripts | Almost Free | TheGuardBook | Help

 

Types of
.Mount/\Commands

.CrystalClear | .ExactName | .ExitELn | .GetValue | .ifCondition | .ifELn | .IsPattern | .ListValue | .NetValue | .NowValue | .RedirRapids | .ReliableReporting | .RestoreValue | .SetELn | .ValueEcho

.RedirRapids
Series

  Show | ZeroFile

.Show/.ShowErr/.ShowAll

Description

  1. Forces output to the console even when running in a redirected script.

Syntax

%.Show%   Command/Program
   

directs STDOUT to the console; STDERR will not be affected

%.ShowErr%   Command/Program
   

directs STDERR to the console; STDOUT will not be affected

%.ShowAll%   Command/Program
   

directs all output (STDOUT/STDERR) to the console

Parameters and Switches

Command/Program

  command or program to be redirected

Errorlevels and Output Variables

none

   

Examples, Notes and Instructions


C:\GuardPost>ntlib :File_Number_Lines Redir_Demo.cmd

  ^  =========================================================================
 /!\    ntlib.cmd 2002.10.18 Advanced NT/2K/XP Command Library (Freeware)
/lib\=========================================================================

 Numbering C:\GuardPost\Redir_Demo.cmd...
_FNL=Redir_Demo.cmd.numbered.txt

C:\GuardPost>TYPE %_FNL%
01. @ECHO OFF
02.
03. :* Create a zero length file to use for the demo
04. %.ZeroFile% FileName.Ext
05.
06. IF EXIST FileName.Ext %.Silent% (
07.    (ECHO: {Silent} Normal Message 1)
08.    (%.ErrEcho% {Silent} Error Message 1)
09. )
10.
11. IF EXIST FileName.Ext %.Quiet% (
12.    (ECHO: {Quiet} Normal Message 2)
13.    (%.ErrEcho% {Quiet} Error Message 2)
14. )
15.
16. IF EXIST FileName.Ext %.Kity% (
17.    (ECHO: {Kity} Normal Message 3)
18.    (%.ErrEcho% {Kity} Error Message 3)
19. )
20.
21. IF EXIST FileName.Ext %.Show% (
22.    (ECHO: {Show} Normal Message 4)
23.    (%.ErrEcho% {Show} Error Message 4)
24. )
25.
26. IF EXIST FileName.Ext %.ShowErr% (
27.    (ECHO: {ShowErr} Normal Message 5)
28.    (%.ErrEcho% {ShowErr} Error Message 5)
29. )
30.
31. IF EXIST FileName.Ext %.ShowAll% (
32.    (ECHO: {ShowAll} Normal Message 6)
33.    (%.ErrEcho% {ShowAll} Error Message 6)
34. )
35.
36. :* Delete the demo file
37. DEL FileName.Ext


[Redir_Demo.cmd in Normal Mode - No Redirection]

  C:\GuardPost>Redir_Demo
   {Quiet} Error Message 2
   {Kity} Normal Message 3
   {Show} Normal Message 4
   {Show} Error Message 4
   {ShowErr} Normal Message 5
   {ShowErr} Error Message 5
   {ShowAll} Normal Message 6
   {ShowAll} Error Message 6

[Redir_Demo.cmd in Quiet Mode - Direct STDOUT to NUL]

  C:\GuardPost>Redir_Demo >NUL
   {Quiet} Error Message 2
   {Show} Normal Message 4
   {Show} Error Message 4
   {ShowErr} Error Message 5
   {ShowAll} Normal Message 6
   {ShowAll} Error Message 6

[Redir_Demo.cmd in Silent Mode - Direct STDOUT and STDERR to NUL]

  C:\GuardPost>Redir_Demo >NUL 2>&1
   {Show} Normal Message 4
   {ShowErr} Error Message 5
   {ShowAll} Normal Message 6
   {ShowAll} Error Message 6

[Redir_Demo.cmd in Logging Mode - Direct STDOUT and STDERR to logfile.txt]

  C:\GuardPost>Redir_Demo >logfile.txt 2>&1
   {Show} Normal Message 4
   {ShowErr} Error Message 5
   {ShowAll} Normal Message 6
   {ShowAll} Error Message 6

  C:\GuardPost>TYPE logfile.txt
  {Quiet} Error Message 2
  {Kity} Normal Message 3
  {Show} Error Message 4
  {ShowErr} Normal Message 5


.ZeroFile - Creates a zero-byte file or "zeroes out" an existing file

KITY=Keep It To Yourself (tell me the good news, suppress any errors)

File_Number_Lines can also be invoked using it's short name:

   ntlib :FNL FileToNumber

The name of the output file will be returned in the variable %_FNL%.

 

   

Related .Mount/\Commands, #Constants, $Functions, :Procedures

Resource

  Short Description
     

 

K

E

Y

Common Commands INTERNAL External /SWITCH Parameter Help text AddonTool
Mounted Commands .Mount/\Command CmdShorthand #Constant $FUNCTION :Procedure !GuardNote
Operating Systems NT/2K/XP/K3 NT Only NT/2K 2K Only 2K/XP XP Only XP/K3 K3 Only 2K/XP/K3

.RedirRapids
Series

  Show | ZeroFile
/\
//\\
//
The\
/Sy
stem\
////
Guard
\
COME ON UP WITH US!
and
Congratulations On Your Decision
to
RISE ABOVE
THE REST!

^
/
!\
/LIB\

TheSystemGuard.com [Revised: 2007-03-29]
Copyright 1995-2007, JWC
Computer Communications,
All Rights Reserved, Worldwide.
 Disclaimer       Privacy       About Us       More


Communication Is Business!

We Master It With Knowledge!

^
/
.\
/M^C\