Project

General

Profile

Bset » History » Revision 3

Revision 2 (Per Amundsen, 08/09/2015 05:49 AM) → Revision 3/11 (Per Amundsen, 05/09/2017 09:31 PM)

_Added in 1.9.0_ 

 */bset [-ta] [-t] <&binvar> <N> <asciivalue> [asciivalue ... asciivalue]* 

 Sets the <N>th byte in binary variable &binvar to the specified ascii value. 

 If the &binvar docent exists it is created. 
 If <N> is larger than the size of &binvar it will be zero filled up to <N> bytes. 
 If you specify multiple "ASCII":http://www.asciitable.com/ values, they are copied to successive positions after byte position N. 

 *Switches* 

 -t - Treat values a plain text. 
 -a - Disables UTF-8 encoding of characters in the range 0-255, as long as the line contains no characters > 255. 

 *Parameters* 

 <&binvar> - The &binvar to modify. 
 <N> - The byte to modify. 
 <asciivalue> - The "ASCII":http://www.asciitable.com/ value to insert. 

 *Example* 

 <pre> 
 alias example { 
   ; Create a binary variable set it to "This is fun!" 
   bset -t &Example 1 This is fun! 
 
   ; Print out the content of the variable 
   echo -a $bvar(&Example, 1-).text 
 } 
 </pre>