0
votes
1answer
78 views

When piping output to a file, why are stderr and stdout in the wrong order?

I have a perl script: warn "1\n"; print "2\n"; warn "3\n"; print "4\n"; I pipe the output to a file: perl script.pl &> foo cat foo: 1 3 2 4 Why isn't the output in order, and how do I ...
0
votes
1answer
334 views

Macxchange Script to Change MAC and Hostname in ubuntu 12.04

I'm trying to adapt a script in backtrack to work with ubuntu. I keep getting an error on line 14 which is the "if [ $? == 0 ]; then" line the script was found on ...
0
votes
1answer
189 views

How to programatically fetch the download status of Google Chrome?

How would I go about determining if Google Chrome is downloading something, and getting the "percent-done" value of that download, from the terminal using a Python, Perl, or Bash script?
3
votes
2answers
1k views

Shell script to restart a process if it outputs a certain piece of text

I have a python program which, from time to time, crashes with a number of different exceptions usually due to network issues. The only way to get it to work is to restart it. How would I write a ...