Bset » History » Version 3
Per Amundsen, 05/09/2017 09:31 PM
| 1 | 1 | Per Amundsen | _Added in 1.9.0_ |
|---|---|---|---|
| 2 | |||
| 3 | 3 | Per Amundsen | */bset [-ta] <&binvar> <N> <asciivalue> [asciivalue ... asciivalue]* |
| 4 | 1 | Per Amundsen | |
| 5 | Sets the <N>th byte in binary variable &binvar to the specified ascii value. |
||
| 6 | |||
| 7 | If the &binvar docent exists it is created. |
||
| 8 | If <N> is larger than the size of &binvar it will be zero filled up to <N> bytes. |
||
| 9 | 2 | Per Amundsen | If you specify multiple "ASCII":http://www.asciitable.com/ values, they are copied to successive positions after byte position N. |
| 10 | 1 | Per Amundsen | |
| 11 | *Switches* |
||
| 12 | |||
| 13 | -t - Treat values a plain text. |
||
| 14 | 3 | Per Amundsen | -a - Disables UTF-8 encoding of characters in the range 0-255, as long as the line contains no characters > 255. |
| 15 | 1 | Per Amundsen | |
| 16 | *Parameters* |
||
| 17 | |||
| 18 | <&binvar> - The &binvar to modify. |
||
| 19 | <N> - The byte to modify. |
||
| 20 | 2 | Per Amundsen | <asciivalue> - The "ASCII":http://www.asciitable.com/ value to insert. |
| 21 | 1 | Per Amundsen | |
| 22 | *Example* |
||
| 23 | |||
| 24 | <pre> |
||
| 25 | alias example { |
||
| 26 | 2 | Per Amundsen | ; Create a binary variable set it to "This is fun!" |
| 27 | 1 | Per Amundsen | bset -t &Example 1 This is fun! |
| 28 | |||
| 29 | 2 | Per Amundsen | ; Print out the content of the variable |
| 30 | 1 | Per Amundsen | echo -a $bvar(&Example, 1-).text |
| 31 | } |
||
| 32 | </pre> |