April 2005
Intermediate to advanced
344 pages
11h 59m
English
NASL allows variables to hold integer values—for example, the number 11. It is also possible to assign numeric values to variables using a hexadecimal representation. You write hexadecimal numbers in NASL using a leading “0x” prefix. For example, the hexadecimal number 0x1b holds the value 27 when represented as an integer in base-10 notation. Type the following script into a file:
h=0x1b;
display ("The value of h is ",h,"\n");Now run it using the NASL interpreter to see the output:
[notroot]$ nasl hex.nasl
The value of h is 27It is also possible to input numerical values in octal notation form,
which uses base- 8 notation by placing a leading
“0” prefix. For example, the
x and y are equivalent in the
following example:
x=014; #octal y=12; #decimal
Read now
Unlock full access