Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Software Development Software Development
Search Search
Search for:
Tech Support Guy > > >

batch output logging and display


(!)

SGT_awesomesauce's Avatar
SGT_awesomesauce SGT_awesomesauce is offline
Computer Specs
Junior Member with 6 posts.
THREAD STARTER
 
Join Date: Aug 2009
08-Aug-2009, 02:43 PM #1
Angry batch output logging and display
Hi,
I am making a script that will update my games svn addons automatically and i am trying to make it output to a log file while still showing everything on the console. any help is appreciated.

Last edited by SGT_awesomesauce; 08-Aug-2009 at 03:02 PM..
Squashman's Avatar
Trusted Advisor with 19,648 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
08-Aug-2009, 03:07 PM #2
yourbatch.bat >output.log >con
SGT_awesomesauce's Avatar
SGT_awesomesauce SGT_awesomesauce is offline
Computer Specs
Junior Member with 6 posts.
THREAD STARTER
 
Join Date: Aug 2009
08-Aug-2009, 03:08 PM #3
thanks, so i can get rid of the append commands in the original right?
Squashman's Avatar
Trusted Advisor with 19,648 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
08-Aug-2009, 03:32 PM #4
Yes.
By launching your batch file this way we are redirecting stanadard output to a text file and the console.
Squashman's Avatar
Trusted Advisor with 19,648 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
08-Aug-2009, 03:39 PM #5
Ah hold on. That's not right.
SGT_awesomesauce's Avatar
SGT_awesomesauce SGT_awesomesauce is offline
Computer Specs
Junior Member with 6 posts.
THREAD STARTER
 
Join Date: Aug 2009
08-Aug-2009, 03:41 PM #6
so i tried it and everything came out fine on the console but only what i edited to have only >output.log showed up on my logfile. btw im running vista 64 if that makes diff
SGT_awesomesauce's Avatar
SGT_awesomesauce SGT_awesomesauce is offline
Computer Specs
Junior Member with 6 posts.
THREAD STARTER
 
Join Date: Aug 2009
08-Aug-2009, 03:42 PM #7
ya it just puts it to the logfile and then takes it back out
mabye a print statement?
Squashman's Avatar
Trusted Advisor with 19,648 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
08-Aug-2009, 04:02 PM #8
You can't redirect console output in batch without a 3rd party utility. In the unix world we would use TEE. There are windows ports of TEE to do this.
SGT_awesomesauce's Avatar
SGT_awesomesauce SGT_awesomesauce is offline
Computer Specs
Junior Member with 6 posts.
THREAD STARTER
 
Join Date: Aug 2009
08-Aug-2009, 04:16 PM #9
i found something that works. i attached the zip file. thanks for your help
Attached Files
File Type: rar tee.rar (20.6 KB, 58 views)
Squashman's Avatar
Trusted Advisor with 19,648 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
08-Aug-2009, 04:21 PM #10
I already have TEE. I have all the GNU Utilities on my PC. I originally was a unix person and did a lot of shell scripting with that. Not sure why it took me so long to remember that.
Either one of these should work for you.
http://unxutils.sourceforge.net/ (I use this one)
http://gnuwin32.sourceforge.net/
__________________
.
SGT_awesomesauce's Avatar
SGT_awesomesauce SGT_awesomesauce is offline
Computer Specs
Junior Member with 6 posts.
THREAD STARTER
 
Join Date: Aug 2009
08-Aug-2009, 06:54 PM #11
ok thanks well its all working great now.
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


Tags
batch, logfile

(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑