Community discussions

MikroTik App
 
sioux
newbie
Topic Author
Posts: 47
Joined: Thu May 25, 2006 10:35 pm
Location: Poland/Tarnów

print output in one line

Fri May 04, 2007 3:10 pm

Hi

is it possible to force print command to print output in one line ??

Im doing something like this
ssh -i key -l user host_ip "/int wire reg print"

and I get output with new line chars
 0 ;;; XXX
   interface=sektor_2 mac-address=00:4F:62:0C:87:BE ap=no wds=no
   rx-rate=11Mbps tx-rate=11Mbps packets=4318194,3967228
   bytes=4161506541,1112106601 frames=4318194,3967228
   frame-bytes=4135634097,1088303233 hw-frames=4318191,3967228
   hw-frame-bytes=4239270369,1183516705 uptime=4d1h25m2s last-activity=60ms
   signal-strength=-65dBm@11Mbps signal-to-noise=38dB
   strength-at-rates=-67dBm@1Mbps 2d16h42m33s70ms,-67dBm@2Mbps
                     2d18h57m53s840ms,-67dBm@5.5Mbps 2d16h42m22s90ms,-
                     65dBm@11Mbps 60ms
   tx-ccq=100% p-throughput=8208 ack-timeout=30 distance=30 framing-mode=none
   last-ip=192.168.4.15 802.1x-port-enabled=yes authentication-type=none
   encryption=none
I want to output look like this (so I can easily use awk) ONE LINE
 0 ;;; XXX interface=sektor_2 mac-address=00:4F:62:0C:87:BE ap=no wds=no rx-rate=11Mbps tx-rate=11Mbps packets=4318194,3967228 bytes=4161506541,1112106601 frames=4318194,3967228 frame-bytes=4135634097,1088303233 hw-frames=4318191,3967228 hw-frame-bytes=4239270369,1183516705 uptime=4d1h25m2s last-activity=60ms signal-strength=-65dBm@11Mbps signal-to-noise=38dB strength-at-rates=-67dBm@1Mbps 2d16h42m33s70ms,-67dBm@2Mbps d18h57m53s840ms,-67dBm@5.5Mbps 2d16h42m22s90ms,-65dBm@11Mbps 60ms tx-ccq=100% p-throughput=8208 ack-timeout=30 distance=30 framing-mode=none last-ip=192.168.4.15  802.1x-port-enabled=yes authentication-type=none encryption=none
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7197
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Fri May 04, 2007 6:04 pm

as far as i know it's not possible. Anyway, why would you need that?
 
sioux
newbie
Topic Author
Posts: 47
Joined: Thu May 25, 2006 10:35 pm
Location: Poland/Tarnów

Fri May 04, 2007 11:25 pm

as far as i know it's not possible. Anyway, why would you need that?
i want to crete script that process text file with output of /int wire reg print and which return some values which i can't get via snmp about user connection ... then i want to graph it with cacti
 
dada
Member Candidate
Member Candidate
Posts: 245
Joined: Tue Feb 21, 2006 1:44 pm

Mon May 07, 2007 11:52 am

as far as i know it's not possible. Anyway, why would you need that?
i want to crete script that process text file with output of /int wire reg print and which return some values which i can't get via snmp about user connection ... then i want to graph it with cacti
See value-list/terse/detail parameters of the print command...
Or you can use a script to return only the values you need:

:put [/int wireless get 0 mtu]

or (to list info for all present wireless interfaces)

:foreach i in=[/interface wireless find] do={:put ("Interface:" . [/interface wireless get $i name]);:put ("Frequency:" . [/interface wireless get $i frequency])}
 
sioux
newbie
Topic Author
Posts: 47
Joined: Thu May 25, 2006 10:35 pm
Location: Poland/Tarnów

Wed May 16, 2007 12:11 pm

:) BIG 10x !!!
 
User avatar
Giepie
Member
Member
Posts: 433
Joined: Mon Sep 13, 2004 12:33 pm
Location: Western Cape, South Africa
Contact:

Re: print output in one line

Sat Jun 21, 2008 2:18 am

Thanks Dada

I've been searching a few hours for that command!

G