![]() |
[QUOTE=apsen;293792]Use cygwin :smile:
[CODE][I]cmd [/I]| tee [-a] [I]log.file[/I][/CODE][/QUOTE] Indeed... If I may be a little "catty" here, it constantly blows my mind that the most popular Operating System in the world doesn't let the Power User do the most basic of things at the Command Line. But then, if popular meant good McDonalds and KFC would be gourmet food.... :wink: |
FRIED CHICKEN
(American Classic) Consider that much of the awesomeness of GNU is the number of programs that can be easily and powerfully used with Bash. As far as I can tell, there isn't much that Bash (meaning specifically only bash) can do that cmd.exe can't do. |
[QUOTE=Dubslow;293796]As far as I can tell, there isn't much that Bash (meaning specifically only bash) can do that cmd.exe can't do.[/QUOTE]
Open the Windows Command Prompt. CD into a directory. "grep" for a particular string within the files. "sort" the results. Then run that through a regex (sed, Perl, et al) to transform it into what you want... Please tell us what, [I][U]exactly[/U][/I], do we have to type into cmd.exe to do that. |
Grep and sort are external programs, not bash features/utilities. It is in theory possible to compile their source code in MSVS and use them with cmd.exe. I'm not defending Windows, just pointing out both the modularity and completeness(/power) of the GNU system.
Edit: IPC is one of the many strong points of *nix. (And yes, in this case IPC is implemented by bash with pipes, etc...) (I have a source here I can reference as soon as I get home.) |
[QUOTE=Dubslow;293804]Grep and sort are external programs, not bash features/utilities. It is in theory possible to compile their source code in MSVS and use them with cmd.exe. I'm not defending Windows, just pointing out both the modularity and completeness(/power) of the GNU system.[/QUOTE]
OK. Then let's then step back... How does one, at the Windows Command Prompt, issue a command and send the results to both a file and the console? Let me make this easy for you... Make the results of the command "ping 8.8.8.8" appear both at the console, and in a file. |
[QUOTE=chalsall;293808]OK.
Then let's then step back... How does one, at the Windows Command Prompt, issue a command and send the results to both a file and the console? Let me make this easy for you... Make the results of the command "ping 8.8.8.8" appear both at the console, and in a file.[/QUOTE] Indeed... I went back and edited my previous post right before you posted, mentioning something related... while l admit I have no clue how to do that with bash, I wouldn't be surprised if it isn't possible with cmd.exe. Edit: Hurg... my brother took so damn long in the hardware store... exactly 60 minutes since my previous post... here's that citation I was talking about: [url]http://www.catb.org/~esr/writings/taoup/html/ch03s01.html[/url] |
[QUOTE=Dubslow;293811]...while l admit I have no clue how to do that with bash, I wouldn't be surprised if it isn't possible with cmd.exe.[/QUOTE]
As apsen points out, it is what Power Users are used to doing under Unix every day... The "tee" program in a pipeline.... |
Not exactly on point, but Windows 7 (and Server 2008R2) install powershell by default, which includes tee. So,[CODE]powershell
ping 127.0.0.1 | tee pinged.txt[/CODE]gives the desired result. |
[QUOTE=sdbardwick;293814]Not exactly on point, but Windows 7 (and Server 2008R2) install powershell by default, which includes tee. So,[CODE]powershell
ping 127.0.0.1 | tee pinged.txt[/CODE]gives the desired result.[/QUOTE] That's good to know. Just wondering... Does "powershell" include Perl? |
I am not a PowerShell expert (or even regular user); I know of some of its capabilities while searching for solutions to specific problems.
With that in mind, I'm going to say no; programming functionality is akin to C#, as PowerShell is .Net based. |
[QUOTE=sdbardwick;293824]With that in mind, I'm going to say no; programming functionality is akin to C#, as PowerShell is .Net based.[/QUOTE]
Is that anything like "Lie back and think of England."? |
| All times are UTC. The time now is 23:13. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.