set MyData = 27or an @ command, which is used for numeric variables, e.g.,
@ MyAnswer = $MyData + 16
set MyList = (the cat is 27 years old)Members of list variables are accessed using []s, indexing from 1, e.g.,
echo $MyList[4] set MyList[4] = 16 echo $MyListSublists are accesed by giving a range, using a -, e.g.,
echo $MyList[2-4]
|| && | ^ & == != =~ !~ <= >= < > << >> + - * / % ! ~ ( )
foreach name (wordlist) ... endSuccessively sets the variable name to each member of wordlist and executes the sequence of commands between this command and the matching end.
if (expr) then ... else if (expr2) then ... else ... endifIf the specified expr is true then the commands to the first else are executed; otherwise if expr2 is true then the commands to the second else are executed, etc. Only one endif is needed. The else part is optional.
switch (string) case str1: ... breaksw ... default: ... breaksw endswEach case label is successively matched against the specified string.
while (expr) ... endExecutes the commands between the while and the matching end while expr evaluates non-zero.