I use wvdial to connect to the net with with my USB modem. It works correctly, and I am quite happy with it. When I start it in XFCE I have it set to output to a borderless, transparent terminal so the status displays on my desktop, life is good. Everything is great, I just want to tweak it.
I'm hoping to filter the output with a 'grep -v' to remove unsightly non-information. Here is the output from a sample run. The output is consistantly the same, except for IP addresses..
--> WvDial: Internet dialer version 1.60 --> Cannot get information for serial port. --> Initializing modem. --> Sending: ATZ ATZ OK --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 OK --> Modem initialized. --> Sending: ATDT#777 --> Waiting for carrier. ATDT#777 CONNECT --> Carrier detected. Waiting for prompt. ~[7f]}#@!}!}!} }9}"}&} } } } }#}%B#}%}%}&3za}'}"}(}"J};~ --> PPP negotiation detected. --> Starting pppd at Mon Nov 14 11:00:06 2011 --> Warning: Could not modify /etc/ppp/pap-secrets: Permission denied --> --> PAP (Password Authentication Protocol) may be flaky. --> Warning: Could not modify /etc/ppp/chap-secrets: Permission denied --> --> CHAP (Challenge Handshake) may be flaky. --> Pid of pppd: 17776 --> Using interface ppp0 --> pppd: >[7f] --> pppd: >[7f] --> pppd: >[7f] --> pppd: >[7f] --> local IP address 10.81.25.50 --> pppd: >[7f] --> remote IP address 10.133.28.10 --> pppd: >[7f] --> primary DNS address 10.133.20.11 --> pppd: >[7f] --> secondary DNS address 10.132.20.11 --> pppd: >[7f] ^CCaught signal 2: Attempting to exit gracefully... --> Terminating on signal 15 --> pppd: >[7f] --> Connect time 0.2 minutes. --> pppd: >[7f] --> pppd: >[7f] --> Disconnecting at Mon Nov 14 11:00:16 2011
Can someone please help me with a command line or script that would filter that output and remove the
--> pppd: >[7f] lines, and possibly the pap/chap warnings(they're bogus).
I've tried several things, with pipes and redirection to grep but haven't hit on anything that seems to effect the output. As a note: in the pppd:/[7f] lines it appears the second '>' character could be just about anything(still don't know what pppd is trying to tell me. :)
EDIT: I got it. Simple stuff really, if you're not a knob. I'm a knob..
wvdial 2>&1 | grep -v -i -E "7f]|pap|chap"
the output is on stderr and pipes are for stdout. the 2>&1 redirects so it will pipe properly.
If you've read this far, thanks.