HP-UX Reference (11i v2 04/09) - 4 File Formats (vol 8)
s
softkeys(4) softkeys(4)
An edit statement is:
• an expression followed by a
;,
• an if statement, or
• a word allocation statement.
Expressions
A simple expression can be any of:
variable single letter from a to z
number unsigned integer
string enclosed in quotes
char enclosed in quotes
last see above
next see above
argument see above
motorola boolean flag
precision boolean flag
command boolean flag
filter boolean flag
word[ number ] see above
Simple expressions can be combined with any of:
string
[number] single-character substring
string [number,number] multiple-character substring
number
+number addition
number-number subtraction
number*number multiplication
number/number division
number%number modulus
string &string concatenation
-number negation
string
==string equality
string !=string inequality
number>=number greater than or equal
number<=number less than or equal
number>number greater than
number<number less than
number&&number logical and
number||number logical or
!number logical not
(string ) grouping
The following functions are also supported and return the indicated results:
strlen(string ) number of characters in string
strchr(string ,char ) index of first char in string ,or−1
strrchr(string ,char ) index of last char in string ,or−1
trim(string ) string without leading/trailing blanks
hex(number) number in hex with leading 0x
octal(number) number in octal with leading 0
Assignments can be done with any of:
variable
=string simple assignment
variable +=number add and assign
variable -=number subtract and assign
variable *=number multiply and assign
variable /=number divide and assign
variable %=number modulus and assign
variable &=string concatenate and assign
HP-UX 11i Version 2: September 2004 − 3 − Hewlett-Packard Company Section 4−−313