Community discussions

 
Zugschlus
just joined
Topic Author
Posts: 10
Joined: Tue Mar 11, 2008 6:58 pm

get command syntax and semantics?

Mon Jan 19, 2009 4:27 pm

 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24206
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: get command syntax and semantics?

Tue Jan 20, 2009 8:58 am

did you want to ask something?
No answer to your question? How to write posts
 
Zugschlus
just joined
Topic Author
Posts: 10
Joined: Tue Mar 11, 2008 6:58 pm

Re: get command syntax and semantics?

Tue Jan 20, 2009 2:20 pm

did you want to ask something?
In fact, yes. I have no idea why my article showed up in the article preview but did end up posted empty. I apologize.

I must be missing some documentation about RouterOS command line basics, since the reference guide doesn't seem to explain how to use the get and find commands.

Here an example of the issue I have with the get command:
[admin@microtik] /ip hotspot user> get tester
[admin@microtik] /ip hotspot user> get tester uptime
[admin@microtik] /ip hotspot user> print
Flags: X - disabled, D - dynamic
 #   SERVER                              NAME                             ADDRESS         PROFILE                             UPTIME
 0                                       tester                                           211WLANhot                          58m9s
Why do I get empty output with the "get tester" command?

Same issue with find:
[admin@microtik] /ip hotspot user> find name=tester
[admin@microtik] /ip hotspot user> find name="tester"
[admin@microtik] /ip hotspot user>                         
What am I doing wrong?

Greetings
Marc, this time checking whether the article gets actually posted
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5934
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: get command syntax and semantics?

Tue Jan 20, 2009 2:27 pm

get by default is not printing anything, it only returns value that you can assign to variable or print on screen.

:put command will put value on screen
:put [get tester uptime]
 
Zugschlus
just joined
Topic Author
Posts: 10
Joined: Tue Mar 11, 2008 6:58 pm

Re: get command syntax and semantics?

Tue Jan 20, 2009 5:16 pm

Ok, thanks. I think I have grokked this now.

Next issue:
[admin@microtik] /ip hotspot user> /system script print
Flags: I - invalid
 0   name="kill-used-wlan-accounts" owner="admin" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff
     last-started=jan/20/2009 15:12:00 run-count=31 source=
       :foreach a in=[/ip hotspot user find uptime!=0 ] do={
         :put $a
         :put [/ip hotspot get $a name]
       }
[admin@microtik] /ip hotspot user> /system script run 0
*1
211AuthHot
*cb

*cc

*cd

*ce

*cf

*d0

*13a

[admin@microtik] /ip hotspot user>                           
I guess that my $a doesn't get assigned a value which can be used in the /ip hotspot user get command, but where does the "211WLANHot", which is a value from the "profile" column of my user list, come from?

Greetings
Marc

Who is online

Users browsing this forum: No registered users and 96 guests