When I run an application (wget.exe) using cmd, the output contains backspace characters that make the output display nicely. But when I run it in perl using open
or backstick with 2>&1, it prints out the output in a different way that doesn't use backspace. How can I still keep the backspace display?
Asked
Active
Viewed 264 times
1

Bao Nhan
- 180
- 7
-
2Running on Windows? Does the output from `wget` change when the output is a file or pipe compared to a terminal? It sounds as if it does. If so, you may have to work out how to persuade `wget` that it is writing to a terminal. On Unix, you'd use a pseudo-tty (or `pty`) for the task; the output of `wget` would be redirected to the `pty` device and the other process would read what `wget` wrote and process appropriately. Double check to see if there's an option to `wget` to do the job automatically. – Jonathan Leffler Jan 10 '12 at 05:04
-
Thanks, the output is different from the terminal output. I'm also looking for a way to do this for Windows. – Bao Nhan Jan 10 '12 at 06:06
-
3I can spell Windows: U, then N, then I, then X. No? Oh, then maybe I can't help further. Sorry. (That's why it was a comment and not an attempt at an answer.) – Jonathan Leffler Jan 10 '12 at 06:14
-
I'm pretty sure wget is outputting the display differently when its not going to STDOUT. Why do you want to preserve the backspace? – Richard Jan 11 '12 at 13:58
-
Try: wget www.bing.com 2>&1 | less – Richard Jan 11 '12 at 13:59
-
I'm curious why you're calling wget instead of using a perl module? Then you woudn't have to worry about parsing output... – derobert Jan 11 '12 at 22:09
-
I used UserAgent to download files but it stops halfway and the file is corrupted sometimes. So I tried to switch to an external tool to do the same job. – Bao Nhan Jan 12 '12 at 17:01