Basically I want to do the opposite of what this guy did... hehe.
http://stackoverflow.com/questions/529395/python-script-print-new-line-each-time-to-shell-rather-than-update-existing-line
I have a program that is telling me how far along it is.
for i in some_list:
#do a bunch of stuff.
print i/len(some_list)*100," percent com...
I have a running cron job that will be going for a while and I'd like to view its stdout. I don't know how important the fact that the process was started by cron is, but I figure I'd mention it. This is on OSX so, I don't have access to things like... /proc/[pid]/..., or truss, or strace. Suggestions of executing with IO redirection ...
Hi all,
I'm running the below imagemgaick command which outputs to stdout:
compare <img1> <img2> -metric MAE null:
I'm trying to capture the output of this command from PHP. Normally I use the exec($cmd,$output) commands which stops cmd output from going to stdout and instead places into the $output array. However for some reason her...
Suppose you run the following commands:
ssh $host1 'while [ 1 ]; do sleep 1; echo "Hello from $HOSTNAME"; done' > /tmp/output
ssh $host2 'while [ 1 ]; do sleep 1; echo "Hello from $HOSTNAME"; done' >> /tmp/output
ssh $host3 'while [ 1 ]; do sleep 1; echo "Hello from $HOSTNAME"; done' >> /tmp/output
Then the output would look like:
...
Is there a way to run shell commands without output buffering?
For example, hexdump file | ./my_script will only pass input from hexdump to my_script in buffered chunks, not line by line.
Actually I want to know a general solution how to make any command unbuffered?
Thanks, Boda Cydo.
...
I need to capture the stdout of a process I execute via subprocess into a string to then put it inside a TextCtrl of a wx application I'm creating. How do I do that?
EDIT: I'd also like to know how to determine when a process terminates
...
Hello,
I asked the other day if data integrity (of flushed data) is kept
even when there are more than one PIPEs streaming into
localhost's STDIN. The answer is NO if the data flushed is large.
http://stackoverflow.com/questions/3445047/data-integrity-question-when-collecting-stdouts-from-multiple-remote-hosts-over-s
But I would like t...
Hi,
I have a small C++ console application which presents a menu then performs the chosen operation.
In addition, I've written a VBScript which runs over the StdOut (achieved by Exec) and enters to StdIn the values.
However when I'm trying to executet this script the console application is stuck in the scanf call and the script doesn'...
When using Aptana with PHP 5.2.3 in debug mode (using thread safe XDebug 2.1.0 for PHP 5.2 VC6) to run a simple multi-line hello world script I get some erratic behaviour on the Aptana 'Console' tab.
I've a hello_world.php script that contains the following:
<?php
$stdout = fopen('php://stdout', 'w');
fwrite($stdout, 'Hello world!');
f...
I have an array of integers
a = [1,2,3,4]
When I do
a.join
Ruby internally calls the to_s method 4 times, which is too slow for my needs.
What is the fastest method to output an big array of integers to console?
I mean:
a = [1,2,3,4........,1,2,3,9], should be:
1234........1239
...
I don't have much of an interest in designing guis (too much work), and I wanna know how it is that programs like vim, and greed work, how is it that vim can modify it's standard out without printing it all out again?, and I often see the output from terminal programs in bright colors, is there some sort of markup language that tells the...
I'm looking for the Perl equivalent to this Python code:
from sys import stdout
if stdout.isatty():
print "yes"
else:
print "no"
...
I'd like to be able to put log messages in the middle of bash functions, without affecting the output of those very functions. For example, consider the following functions log() and get_animals():
# print a log a message
log ()
{
echo "Log message: $1"
}
get_animals()
{
log "Fetching animals"
echo "cat dog mouse"
}
value...
Hi,
I found tcl exec command returns string from stdout first then stderr. For example, my following "test script" generates messages in this order:
puts "test started"
puts stderr "some non-fatal error goes to stderr"
puts "test passed"
Then I execute the script like this:
set ret [ catch { exec sh -c $cmd } msg ]
and what I get...
Hi,
I'm struggling with print and unicode conversion. Here is some code executed in the 2.5 windows interpreter.
>>> import sys
>>> print sys.stdout.encoding
cp850
>>> print u"é"
é
>>> print u"é".encode("cp850")
é
>>> print u"é".encode("utf8")
├®
>>> print u"é".__repr__()
u'\xe9'
>>> class A():
... def __unicode__(self):
... r...
How to make python 3 (3.1) to print("Some text") to stdout in utf8 ...
or how to output raw bytes..
Test.py
TestText = "Test - āĀēĒčČ..šŠūŪžŽ" # this is UTF-8
TestText2 = b"Test2 - \xc4\x81\xc4\x80\xc4\x93\xc4\x92\xc4\x8d\xc4\x8c..\xc5\xa1\xc5\xa0\xc5\xab\xc5\xaa\xc5\xbe\xc5\xbd" # just bytes
print(sys.getdefaultencoding())
prin...
Hi Guys.
I am trying to create a script that will run wget to a few sites and check if we receive a 200 OK from the site.
My problem is that the result of wget application is shown in the stdout. Is there a way I can hide this.
My current script is:
RESULT=`wget -O wget.tmp http://mysite.com 2>&1`
Later I will use regex to look for...
Possible Duplicate:
Read a password from std::cin
I want to cin>>input but when they input something i don't want it to be visible to them. Like when you use passwd in unix to change your password where it doesn't show what you typed. i hope it is clear what i am asking. Thank you in advance.
...
Hi,
I need to capture the output and error of a command in my bash script and know whether the command succeeded or not.
At the moment, I am capturing both like this:
output=$(mycommand 2>&1)
I then need to check the exit value of mycommand. If it failed, I need to do some stuff with the output, if the command succeeded, I don't nee...
How does one capture the standard output/error of a process started by a Process.start() to a string?
...