Ubiquiti UniFi Command-Line Interface Reference
Please share with your friends...
  • 2
  • 1
  •  
  •  
  • 1
  • 1
  •  
  •  
  •  
  •  
    5
    Shares


⇐ BackPageNext ⇒
Commands

E

ABCDEFGHIJKLMNOPQRSTUVWXYZ


echo

Print the specified ARGs to stdout

echo [-neE] [ARG...]

        -n      Suppress trailing newline
        -e      Interpret backslash-escaped characters (i.e., \t=tab)
        -E      Disable interpretation of backslash-escaped characters
Example

The following example shows how to display the value of the $PATH environment variable.

# echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin
[_/su_spoiler]


egrep
egrep


env

Print the current environment or run PROG after setting up the specified environment

env [-iu] [-] [name=value]... [PROG [ARGS]]

        -, -i   Start with an empty environment
        -u      Remove variable from the environment
Example

The following example shows how to display the current environment variables.

# env
USER=ubnt
OLDPWD=/lib/modules
HOME=/etc/persistent
SSH_TTY=/dev/pts/0
PS1=US.v3.3.5#
LOGNAME=ubnt
TERM=xterm
PATH=/usr/bin:/bin:/usr/sbin:/sbin
SHELL=/bin/sh
PWD=/lib/modules/3.6.5
SSH_CONNECTION=192.168.1.100 54948 192.168.1.119 22
[_/su_spoiler]


expr

Print the value of EXPRESSION to standard output

expr EXPRESSION

        ARG1 | ARG2     ARG1 if it is neither null nor 0, otherwise ARG2
        ARG1 & ARG2     ARG1 if neither argument is null or 0, otherwise 0
        ARG1 < ARG2     1 if ARG1 is less than ARG2, else 0. Similarly:
        ARG1 = ARG2
        ARG1 > ARG2
        ARG1 + ARG2     Sum of ARG1 and ARG2. Similarly:
        ARG1 - ARG2
        ARG1 * ARG2
        ARG1 / ARG2
        ARG1 % ARG2
        STRING : REGEXP          Anchored pattern match of REGEXP in STRING
        match STRING REGEXP      Same as STRING : REGEXP
        substr STRING POS LENGTH Substring of STRING, POS counted from 1
        index STRING CHARS       Index in STRING where any CHARS is found, or 0
        length STRING            Length of STRING
        quote TOKEN              Interpret TOKEN as a string, even if
                                 it is a keyword like 'match' or an
                                 operator like '/'
        (EXPRESSION)             Value of EXPRESSION
Beware that many operators need to be escaped or quoted for shells. Comparisons are arithmetic if both ARGs are numbers, else lexicographical. Pattern matches return the string matched between \( and \) or null; if \( and \) are not used, they return the number of characters matched or 0.
Example

The following examples show how to perform simple arithmetic.

# expr 1 + 2 + 3 + 4
10
# expr 100 - 10 - 9 - 8 - 7
65
# expr 2 \* 3 \* 4 \* 5
120
# expr 100 / 50
2
[_/su_spoiler]
ABCDEFGHIJKLMNOPQRSTUVWXYZ
⇐ BackPageNext ⇒

Ubiquiti UniFi Command-Line Interface Reference

Please share with your friends...
  • 2
  • 1
  •  
  •  
  • 1
  • 1
  •  
  •  
  •  
  •  
    5
    Shares
Tagged on:                     

Leave a Reply