The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > Windows & DOS: Issues & Discussions
Google UNIX.COM


Windows & DOS: Issues & Discussions Questions involving Unix to Windows (Desktop or Server) go here. Any Windows/DOS questions should go here as well.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
I want a command in solaris equivalent to glance in HP-UX grrajeish SUN Solaris 6 06-26-2008 05:17 AM
Equivalent command to 'stat' im_new Shell Programming and Scripting 3 12-27-2007 02:28 AM
equivalent of ptree command in zsh dhams Shell Programming and Scripting 3 09-11-2007 04:07 PM
Command equivalent to DOS mode for SCO 5.0.6 jgt UNIX for Advanced & Expert Users 3 05-11-2007 04:10 AM
equivalent prtdiag and prtconf command antalexi SUN Solaris 4 01-21-2005 01:24 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-17-2006
Registered User
 

Join Date: Aug 2005
Posts: 111
Stumble this Post!
Question SQL Spool equivalent command in DOS

This question maybe in the wrong category but I'm posting here due to urgency.
In DOS is there a command to perform a similar function to spool command in SQL or Script command in UNIX?
I want to print all command line output to a file but I don't want to use the echo command for each line.

Any help will be appreciated.

Steve
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 01-17-2006
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Stumble this Post!
I have moved this to the appropriate forum.

The easiest way to achieve this would be to put all your commands into a batch file, and then redirect the output.

Code:
C:\putty>type foo.bat
echo "this is my batch file"
dir

C:\putty>foo.bat > foo.out 2>&1

C:\putty>type foo.out

C:\putty>echo "this is my batch file"
"this is my batch file"

C:\putty>dir
 Volume in drive C is SYSTEM
 Volume Serial Number is E032-0520

 Directory of C:\putty

17/01/2006  22:36    <DIR>          .
17/01/2006  22:36    <DIR>          ..
17/01/2006  22:34                36 foo.bat
17/01/2006  22:36                 0 foo.out
18/09/2005  03:03           131,072 pageant.exe
18/09/2005  03:03           266,240 plink.exe
18/09/2005  03:03           286,720 pscp.exe
18/09/2005  03:03           286,720 psftp.exe
18/09/2005  01:30            29,267 putty.cnt
18/09/2005  03:03           430,080 putty.exe
18/09/2005  01:30           595,500 putty.hlp
18/09/2005  03:03           167,936 puttygen.exe
              10 File(s)      2,193,571 bytes
               2 Dir(s)  24,182,276,096 bytes free
Yes... UNIX-style redirection works in "cmd"

Cheers
ZB
Reply With Quote
  #3 (permalink)  
Old 01-17-2006
Registered User
 

Join Date: Aug 2005
Posts: 111
Stumble this Post!
Smile

Thanks zazzybob!
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:54 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0