Hello, On Wed, 28 Sep 2011, David C. Rankin wrote:
This is baffling... another rankinism...
Nah. Just some standard stuff. [..]
Here is the log:
Found AV/C device with GUID 0x08004601017ede99 Waiting for DV... Capture Started "dcrv-1999.05.08_09-37-33.dv": 467.72 MiB 4087 frames timecode 00:02:16.13 date 1999.05.08 09:41:49 ^M ^M"dcrv-1999.05.08_16-23-57.dv": 784.15 MiB 6852 frames timecode 00:06:05.03 date 1999.05.08 16:37:40 ^M ^M"dcrv-1999.05.08_19-03-13.dv": 718.69 MiB 6280 frames timecode 00:09:34.19 date 1999.05.08 19:06:42
Literally, every line output from dvgrab has an extra:
'^M.....80spaces.....^M' [..] If it is dvgrab, then is there a way I can have bash strip this info before it gets written to the files? The terminal does it by default evidently, because the output I get from stdout/stderr looks correct in konsole, so can I pipe the output through something (hopefully lighter than sed) that would strip it before I pipe it to tee?
It IS dvgrab, counting on logging to a terminal. Other programs do the right thing[tm] and switch behaviour accordingly. Consider this: $ for i in $(seq 1 100); do printf "\r%3i%%" $i; sleep 0.1; done; printf "\n"; Looks fine in your terminal, eh? Now, log that (I have a /dh/ in the ramdisk /dev/shm ;) $ { for i in $(seq 1 100); do printf "\r%3i%%" $i; sleep 0.1; done; printf "\n"; } > /dev/shm/dh/process.log 2>&1 ==== $ od -tx1z /dev/shm/dh/process.log ==== 0000000 0d 20 20 31 25 0d 20 20 32 25 0d 20 20 33 25 0d >. 1%. 2%. 3%.< 0000020 20 20 34 25 0d 20 20 35 25 0d 20 20 36 25 0d 20 > 4%. 5%. 6%. < 0000040 20 37 25 0d 20 20 38 25 0d 20 20 39 25 0d 20 31 > 7%. 8%. 9%. 1< 0000060 30 25 0d 20 31 31 25 0d 20 31 32 25 0d 20 31 33 >0%. 11%. 12%. 13< ==== ^^ ^^ ^^ == \r == ^M And so, no, the terminal doesn't strip anything, but it _interprets_ the \r and consequently erases the line (as in my example). For more advanced terminal stuff see 'man console_codes' ;) So, yes, you need to strip the stuff with sed, as neither grep nor cut would help, I think. But don't worry about "light", one sed suffices and once started ... For my example { ... } 2>&1 | tee /dev/stderr | sed 's/.*\r//' > log works nicely (it leaves the 100% in the log, as is probably wanted). For dvgrab, try e.g. to be more specific such as { ... } 2>&1 | tee /dev/stderr | sed 's/^[[:space:]]*\r//' > log HTH, -dnh -- Apple's original usability studies contradicted the Xerox ones. The difference? Xerox studied people who were used to the idea of computers and user interfaces. Apple studied random lusers." -- Peter da Silva -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org