Re: about pipes
- From: Bill Marcum <marcumbill@xxxxxxxxxxxxx>
- Date: Mon, 19 Mar 2007 12:59:57 GMT
On Mon, 19 Mar 2007 12:38:20 +0100, Christophe Maquaire
<christophe.maquaire.toomuchhere@xxxxxxxxxxxxxxxxx> wrote:
Le Mon, 19 Mar 2007 12:15:50 +0100, Christophe Maquaire a écrit :
#! /bin/sh
echo "emulation imprimante"
cat /dev/ttyS0 | sed -e 's/[^M]/ /' | awk '{ if(match($0,":")) printf
"%s", $0; else printf "%s\n", $0 }' >> /home/christophe/alarme/$(date
+%Y_%m)>> /home/christophe/alarme/$(date +%Y_%m) &
hum, copy/paste mistake in this post:
cat /dev/ttyS0 | sed -e 's/[^M]/ /' | awk '{ if(match($0,":")) printf
"%s", $0; else printf "%s\n", $0 }' >> /home/christophe/alarme/$(date
+%Y_%m)
If you use sed to remove the ^M characters, you have to use a real
ctrl-M, not the two characters '^M'. It would be better to add
gsub(/\015/," ",$0) to the awk command.
--
I don't drink, I don't like it, it makes me feel too good.
-- K. Coates
.
- Follow-Ups:
- Re: about pipes
- From: Christophe Maquaire
- Re: about pipes
- References:
- about pipes
- From: Christophe Maquaire
- Re: about pipes
- From: Christophe Maquaire
- about pipes
- Prev by Date: Re: about pipes
- Next by Date: Re: Capturing PID in bash
- Previous by thread: Re: about pipes
- Next by thread: Re: about pipes
- Index(es):
Relevant Pages
|