Another binary manipulation thread.


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Another binary manipulation thread.
# 1  
Old 08-13-2013
Another binary manipulation thread.

As bash cannot cope with a byte value of zero inside a variable then this is a workaround.

This code is a DEMO to show how to create a _string_variable_ containing all of the values of 1 to 255 as single characters and 0, (zero), as a two byte character set of \0.
The real binary files are 512 bytes in size and contains 2 zeros.
The _string_variable_ is 514 bytes in size and contains \0 for the byte value zero.

Ignore the simplicity of the for loops to generate the binary files it is the 'text' variable that is ultimately important.

I am not sure if it is of any use but shows that the bash shell can cope with binary...
Code:
#!/bin/bash --posix

# Creating a binary variable from a binary file...

> /tmp/SomeBinaryFile.dat
> /tmp/BinData.dat

# This loop is to give a usable 512 byte binary file only from 0x00 to 0xFF continuous repeated twice...
clear
echo "Generate a 512 byte binary file..."
echo ""
for character in $( seq 0 1 255 )
do
	# Note:- The backticks and the four escape characters ARE required...
	char=`printf '\\\\x'"%02x" $character`
	printf "$char" >> /tmp/SomeBinaryfile.dat
done
for character in $( seq 0 1 255 )
do
	# Do a repeat of the last loop, copy-n-paste is SOOO easy... ;o)
	char=`printf '\\\\x'"%02x" $character`
	printf "$char" >> /tmp/SomeBinaryfile.dat
done

# Now display the file information...
ls -l /tmp/SomeBinaryFile.dat

# Now do a HEX dump as proof...
echo ""
hexdump -C /tmp/SomeBinaryFile.dat
echo "" 

# We are now going to create a variable with pseudo-zeros inside it. All other 8 bit values will eventually be real.
character=""
for subscript in $( seq 0 1 255 )
do
	hexdata=`hexdump -n1 -s$subscript -v -e '1/1 "%02x"' /tmp/SomeBinaryFile.dat`
	char=`printf '\\\\x'"$hexdata"`
	if [ "$hexdata" == "00" ]
	then
		character=$character'\\0'
	fi
	character="$character$char"
done
# Repeat the above, copy-n-paste again... ;o)
for subscript in $( seq 256 1 511 )
do
	hexdata=`hexdump -n1 -s$subscript -v -e '1/1 "%02x"' /tmp/SomeBinaryFile.dat`
	char=`printf '\\\\x'"$hexdata"`
	if [ "$hexdata" == "00" ]
	then
		# Note:- Two backslashes required here to generate the \0 reqired for the variable.
		character=$character'\\0'
	fi
	character=$character$char
done

# Now generate the variable 'text' filled with binary except 0, this is changed to \0 inside the variable.
text=`echo -e -n "$character"`
echo -e -n "$text" > /tmp/BinData.dat
hexdump -C /tmp/BinData.dat

# Proof run.
echo -e "$text"
echo ""
echo "Length of string variable is ${#text} characters, NOT 512 characters..."
echo ""
echo "NOTE:- Zero, (00), is missing and replaced by real text '\0', as a"
echo "pseudo-zero. All other byte values exist..."
echo ""

Here is the display on a Macbook Pro 13" OSX 10.7.5 using the default Terminal.
Code:
Last login: Tue Aug 13 20:30:47 on ttys000
AMIGA:barrywalker~> ./bin_variable.sh

Generate a 512 byte binary file...

-rw-r--r--  1 barrywalker  wheel  512 13 Aug 21:19 /tmp/SomeBinaryFile.dat

00000000  00 01 02 03 04 05 06 07  08 09 0a 0b 0c 0d 0e 0f  |................|
00000010  10 11 12 13 14 15 16 17  18 19 1a 1b 1c 1d 1e 1f  |................|
00000020  20 21 22 23 24 25 26 27  28 29 2a 2b 2c 2d 2e 2f  | !"#$%&'()*+,-./|
00000030  30 31 32 33 34 35 36 37  38 39 3a 3b 3c 3d 3e 3f  |0123456789:;<=>?|
00000040  40 41 42 43 44 45 46 47  48 49 4a 4b 4c 4d 4e 4f  |@ABCDEFGHIJKLMNO|
00000050  50 51 52 53 54 55 56 57  58 59 5a 5b 5c 5d 5e 5f  |PQRSTUVWXYZ[\]^_|
00000060  60 61 62 63 64 65 66 67  68 69 6a 6b 6c 6d 6e 6f  |`abcdefghijklmno|
00000070  70 71 72 73 74 75 76 77  78 79 7a 7b 7c 7d 7e 7f  |pqrstuvwxyz{|}~.|
00000080  80 81 82 83 84 85 86 87  88 89 8a 8b 8c 8d 8e 8f  |................|
00000090  90 91 92 93 94 95 96 97  98 99 9a 9b 9c 9d 9e 9f  |................|
000000a0  a0 a1 a2 a3 a4 a5 a6 a7  a8 a9 aa ab ac ad ae af  |................|
000000b0  b0 b1 b2 b3 b4 b5 b6 b7  b8 b9 ba bb bc bd be bf  |................|
000000c0  c0 c1 c2 c3 c4 c5 c6 c7  c8 c9 ca cb cc cd ce cf  |................|
000000d0  d0 d1 d2 d3 d4 d5 d6 d7  d8 d9 da db dc dd de df  |................|
000000e0  e0 e1 e2 e3 e4 e5 e6 e7  e8 e9 ea eb ec ed ee ef  |................|
000000f0  f0 f1 f2 f3 f4 f5 f6 f7  f8 f9 fa fb fc fd fe ff  |................|
00000100  00 01 02 03 04 05 06 07  08 09 0a 0b 0c 0d 0e 0f  |................|
00000110  10 11 12 13 14 15 16 17  18 19 1a 1b 1c 1d 1e 1f  |................|
00000120  20 21 22 23 24 25 26 27  28 29 2a 2b 2c 2d 2e 2f  | !"#$%&'()*+,-./|
00000130  30 31 32 33 34 35 36 37  38 39 3a 3b 3c 3d 3e 3f  |0123456789:;<=>?|
00000140  40 41 42 43 44 45 46 47  48 49 4a 4b 4c 4d 4e 4f  |@ABCDEFGHIJKLMNO|
00000150  50 51 52 53 54 55 56 57  58 59 5a 5b 5c 5d 5e 5f  |PQRSTUVWXYZ[\]^_|
00000160  60 61 62 63 64 65 66 67  68 69 6a 6b 6c 6d 6e 6f  |`abcdefghijklmno|
00000170  70 71 72 73 74 75 76 77  78 79 7a 7b 7c 7d 7e 7f  |pqrstuvwxyz{|}~.|
00000180  80 81 82 83 84 85 86 87  88 89 8a 8b 8c 8d 8e 8f  |................|
00000190  90 91 92 93 94 95 96 97  98 99 9a 9b 9c 9d 9e 9f  |................|
000001a0  a0 a1 a2 a3 a4 a5 a6 a7  a8 a9 aa ab ac ad ae af  |................|
000001b0  b0 b1 b2 b3 b4 b5 b6 b7  b8 b9 ba bb bc bd be bf  |................|
000001c0  c0 c1 c2 c3 c4 c5 c6 c7  c8 c9 ca cb cc cd ce cf  |................|
000001d0  d0 d1 d2 d3 d4 d5 d6 d7  d8 d9 da db dc dd de df  |................|
000001e0  e0 e1 e2 e3 e4 e5 e6 e7  e8 e9 ea eb ec ed ee ef  |................|
000001f0  f0 f1 f2 f3 f4 f5 f6 f7  f8 f9 fa fb fc fd fe ff  |................|
00000200

00000000  00 01 02 03 04 05 06 07  08 09 0a 0b 0c 0d 0e 0f  |................|
00000010  10 11 12 13 14 15 16 17  18 19 1a 1b 1c 1d 1e 1f  |................|
00000020  20 21 22 23 24 25 26 27  28 29 2a 2b 2c 2d 2e 2f  | !"#$%&'()*+,-./|
00000030  30 31 32 33 34 35 36 37  38 39 3a 3b 3c 3d 3e 3f  |0123456789:;<=>?|
00000040  40 41 42 43 44 45 46 47  48 49 4a 4b 4c 4d 4e 4f  |@ABCDEFGHIJKLMNO|
00000050  50 51 52 53 54 55 56 57  58 59 5a 5b 5c 5d 5e 5f  |PQRSTUVWXYZ[\]^_|
00000060  60 61 62 63 64 65 66 67  68 69 6a 6b 6c 6d 6e 6f  |`abcdefghijklmno|
00000070  70 71 72 73 74 75 76 77  78 79 7a 7b 7c 7d 7e 7f  |pqrstuvwxyz{|}~.|
00000080  80 81 82 83 84 85 86 87  88 89 8a 8b 8c 8d 8e 8f  |................|
00000090  90 91 92 93 94 95 96 97  98 99 9a 9b 9c 9d 9e 9f  |................|
000000a0  a0 a1 a2 a3 a4 a5 a6 a7  a8 a9 aa ab ac ad ae af  |................|
000000b0  b0 b1 b2 b3 b4 b5 b6 b7  b8 b9 ba bb bc bd be bf  |................|
000000c0  c0 c1 c2 c3 c4 c5 c6 c7  c8 c9 ca cb cc cd ce cf  |................|
000000d0  d0 d1 d2 d3 d4 d5 d6 d7  d8 d9 da db dc dd de df  |................|
000000e0  e0 e1 e2 e3 e4 e5 e6 e7  e8 e9 ea eb ec ed ee ef  |................|
000000f0  f0 f1 f2 f3 f4 f5 f6 f7  f8 f9 fa fb fc fd fe ff  |................|
00000100  00 01 02 03 04 05 06 07  08 09 0a 0b 0c 0d 0e 0f  |................|
00000110  10 11 12 13 14 15 16 17  18 19 1a 1b 1c 1d 1e 1f  |................|
00000120  20 21 22 23 24 25 26 27  28 29 2a 2b 2c 2d 2e 2f  | !"#$%&'()*+,-./|
00000130  30 31 32 33 34 35 36 37  38 39 3a 3b 3c 3d 3e 3f  |0123456789:;<=>?|
00000140  40 41 42 43 44 45 46 47  48 49 4a 4b 4c 4d 4e 4f  |@ABCDEFGHIJKLMNO|
00000150  50 51 52 53 54 55 56 57  58 59 5a 5b 5c 5d 5e 5f  |PQRSTUVWXYZ[\]^_|
00000160  60 61 62 63 64 65 66 67  68 69 6a 6b 6c 6d 6e 6f  |`abcdefghijklmno|
00000170  70 71 72 73 74 75 76 77  78 79 7a 7b 7c 7d 7e 7f  |pqrstuvwxyz{|}~.|
00000180  80 81 82 83 84 85 86 87  88 89 8a 8b 8c 8d 8e 8f  |................|
00000190  90 91 92 93 94 95 96 97  98 99 9a 9b 9c 9d 9e 9f  |................|
000001a0  a0 a1 a2 a3 a4 a5 a6 a7  a8 a9 aa ab ac ad ae af  |................|
000001b0  b0 b1 b2 b3 b4 b5 b6 b7  b8 b9 ba bb bc bd be bf  |................|
000001c0  c0 c1 c2 c3 c4 c5 c6 c7  c8 c9 ca cb cc cd ce cf  |................|
000001d0  d0 d1 d2 d3 d4 d5 d6 d7  d8 d9 da db dc dd de df  |................|
000001e0  e0 e1 e2 e3 e4 e5 e6 e7  e8 e9 ea eb ec ed ee ef  |................|
000001f0  f0 f1 f2 f3 f4 f5 f6 f7  f8 f9 fa fb fc fd fe ff  |................|
00000200
	


!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????


!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

Length of string variable is 514 characters, NOT 512 characters...

NOTE:- Zero, (00), is missing and replaced by real text '\0', as a
pseudo-zero. All other byte values exist...

AMIGA:barrywalker~> _

# 2  
Old 08-20-2013
The bash shell can deal with binary output, sure, but binary input?
# 3  
Old 08-20-2013
Hi DGPickett...
Quote:
The bash shell can deal with binary output, sure, but binary input?
I assume you mean from keyboard input...
Code:
Last login: Tue Aug 20 21:18:52 on ttys000
AMIGA:barrywalker~> > /tmp/bin.dat
AMIGA:barrywalker~> read -p "INPUT:- " -e text ; echo -e -n "$text" > /tmp/bin.dat
INPUT:- \\\xFF\\\x00\\\xFF\\\x00
AMIGA:barrywalker~> hexdump -C /tmp/bin.dat
00000000  ff 00 ff 00                                       |....|
00000004
AMIGA:barrywalker~> _

# 4  
Old 08-20-2013
The tty may be cooking up some binary input, but this is far short of handlong nulls -- they just passed through. Bash did not detect them as null.
# 5  
Old 08-21-2013
Hi DGPickett...

I appreciate that the _string_ is not an actual character zero, but the original code replaces character zero with two characters - "\0".

I am on holiday/vacation ATM so gimme a bit of time to INPUT to a variable with the two pseudo-zero characters for an actual character zero and 0xFF as a single byte, a total of three characters...

If I get stuck I will certainly admit it... ;o)

---------- Post updated 21-08-13 at 09:52 AM ---------- Previous update was 20-08-13 at 10:29 PM ----------

Hi DGPickett...

Slightly bigger than 3 bytes... ;o)

This generates a variable "text" 10 bytes long containing three "\0" pseudo-zeros and other non-ascii characters. The binary file generated is either 7 or 10 bytes in size......
Code:
Last login: Wed Aug 21 08:53:01 on ttys000
AMIGA:barrywalker~> read -p "INPUT:- " character
INPUT:- \\\xFF\\\\0\\\x7F\\\\0\\\x80\\\\0\\\xFF
AMIGA:barrywalker~> text=`echo -e -n "$character"`
AMIGA:barrywalker~> echo -n "$text" > /tmp/bin.dat
AMIGA:barrywalker~> hexdump -C /tmp/bin.dat
00000000  ff 5c 30 7f 5c 30 80 5c  30 ff                    |.\0.\0.\0.|
0000000a
AMIGA:barrywalker~> echo -e -n "$text" > /tmp/bin.dat
AMIGA:barrywalker~> hexdump -C /tmp/bin.dat
00000000  ff 00 7f 00 80 00 ff                              |.......|
00000007
AMIGA:barrywalker~> # Real string length should be 10 bytes.
AMIGA:barrywalker~> echo "${#text}"
10
AMIGA:barrywalker~> _

This is the best workaround I can do WRT to byte value zero and reading from the keyboard.
# 6  
Old 08-23-2013
Replied to DGPickett and just noticed the reply added itself as an EDIT to my previous upolad...

Sorry for any inconvenience...
# 7  
Old 08-23-2013
Reading the bash man page, 'read -n 1' looks like a nice start. I am not sure what happens when you read a line feed or white space, so I guess I have to try it. I wrote all256 to put out bytes 0x00 through 0xff.
Code:
$ all256|while read -n 1 c
> do
>  echo read "'$c'"
> done
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read '
read ''
read ''
read '
      '
read '
      '
'ead '
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read '
read ''
read ''
read ''
read ''
read ''
read '!'
read '"'
read '#'
read '$'
read '%'
read '&'
read '''
read '('
read ')'
read '*'
read '+'
read ','
read '-'
read '.'
read '/'
read '0'
read '1'
read '2'
read '3'
read '4'
read '5'
read '6'
read '7'
read '8'
read '9'
read ':'
read ';'
read '<'
read '='
read '>'
read '?'
read '@'
read 'A'
read 'B'
read 'C'
read 'D'
read 'E'
read 'F'
read 'G'
read 'H'
read 'I'
read 'J'
read 'K'
read 'L'
read 'M'
read 'N'
read 'O'
read 'P'
read 'Q'
read 'R'
read 'S'
read 'T'
read 'U'
read 'V'
read 'W'
read 'X'
read 'Y'
read 'Z'
read '['
read ']'
read '^'
read '_'
read '`'
read 'a'
read 'b'
read 'c'
read 'd'
read 'e'
read 'f'
read 'g'
read 'h'
read 'i'
read 'j'
read 'k'
read 'l'
read 'm'
read 'n'
read 'o'
read 'p'
read 'q'
read 'r'
read 's'
read 't'
read 'u'
read 'v'
read 'w'
read 'x'
read 'y'
read 'z'
read '{'
read '|'
read '}'
read '~'
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ''
read ' '
read '¡'
read '¢'
read '£'
read '¤'
read '¥'
read '¦'
read '§'
read '¨'
read '©'
read 'ª'
read '«'
read '¬'
read '­'
read '®'
read '¯'
read '°'
read '±'
read '²'
read '³'
read '´'
read 'µ'
read '¶'
read '·'
read '¸'
read '¹'
read 'º'
read '»'
read '¼'
read '½'
read '¾'
read '¿'
read 'À'
read 'Á'
read 'Â'
read 'Ã'
read 'Ä'
read 'Å'
read 'Æ'
read 'Ç'
read 'È'
read 'É'
read 'Ê'
read 'Ë'
read 'Ì'
read 'Í'
read 'Î'
read 'Ï'
read 'Ð'
read 'Ñ'
read 'Ò'
read 'Ó'
read 'Ô'
read 'Õ'
read 'Ö'
read '×'
read 'Ø'
read 'Ù'
read 'Ú'
read 'Û'
read 'Ü'
read 'Ý'
read 'Þ'
read 'ß'
read 'à'
read 'á'
read 'â'
read 'ã'
read 'ä'
read 'å'
read 'æ'
read 'ç'
read 'è'
read 'é'
read 'ê'
read 'ë'
read 'ì'
read 'í'
read 'î'
read 'ï'
read 'ð'
read 'ñ'
read 'ò'
read 'ó'
read 'ô'
read 'õ'
read 'ö'
read '÷'
read 'ø'
read 'ù'
read 'ú'
read 'û'
read 'ü'
read 'ý'
read 'þ'
read 'ÿ'
$ all256|while read -n 1 c; do  echo read "'$c'"; done|cat -vt
read ''
read '^A'
read '^B'
read '^C'
read '^D'
read '^E'
read '^F'
read '^G'
read '^H'
read ''
read ''
read '^K'
read '^L'
read '^M'
read '^N'
read '^O'
read '^P'
read '^Q'
read '^R'
read '^S'
read '^T'
read '^U'
read '^V'
read '^W'
read '^X'
read '^Y'
read '^Z'
read '^['
read '^\'
read '^]'
read '^^'
read '^_'
read ''
read '!'
read '"'
read '#'
read '$'
read '%'
read '&'
read '''
read '('
read ')'
read '*'
read '+'
read ','
read '-'
read '.'
read '/'
read '0'
read '1'
read '2'
read '3'
read '4'
read '5'
read '6'
read '7'
read '8'
read '9'
read ':'
read ';'
read '<'
read '='
read '>'
read '?'
read '@'
read 'A'
read 'B'
read 'C'
read 'D'
read 'E'
read 'F'
read 'G'
read 'H'
read 'I'
read 'J'
read 'K'
read 'L'
read 'M'
read 'N'
read 'O'
read 'P'
read 'Q'
read 'R'
read 'S'
read 'T'
read 'U'
read 'V'
read 'W'
read 'X'
read 'Y'
read 'Z'
read '['
read ']'
read '^'
read '_'
read '`'
read 'a'
read 'b'
read 'c'
read 'd'
read 'e'
read 'f'
read 'g'
read 'h'
read 'i'
read 'j'
read 'k'
read 'l'
read 'm'
read 'n'
read 'o'
read 'p'
read 'q'
read 'r'
read 's'
read 't'
read 'u'
read 'v'
read 'w'
read 'x'
read 'y'
read 'z'
read '{'
read '|'
read '}'
read '~'
read '^?'
read 'M-^@'
read 'M-^A'
read 'M-^B'
read 'M-^C'
read 'M-^D'
read 'M-^E'
read 'M-^F'
read 'M-^G'
read 'M-^H'
read 'M-^I'
read 'M-
'
read 'M-^K'
read 'M-^L'
read 'M-^M'
read 'M-^N'
read 'M-^O'
read 'M-^P'
read 'M-^Q'
read 'M-^R'
read 'M-^S'
read 'M-^T'
read 'M-^U'
read 'M-^V'
read 'M-^W'
read 'M-^X'
read 'M-^Y'
read 'M-^Z'
read 'M-^['
read 'M-^\'
read 'M-^]'
read 'M-^^'
read 'M-^_'
read 'M- '
read 'M-!'
read 'M-"'
read 'M-#'
read 'M-$'
read 'M-%'
read 'M-&'
read 'M-''
read 'M-('
read 'M-)'
read 'M-*'
read 'M-+'
read 'M-,'
read 'M--'
read 'M-.'
read 'M-/'
read 'M-0'
read 'M-1'
read 'M-2'
read 'M-3'
read 'M-4'
read 'M-5'
read 'M-6'
read 'M-7'
read 'M-8'
read 'M-9'
read 'M-:'
read 'M-;'
read 'M-<'
read 'M-='
read 'M->'
read 'M-?'
read 'M-@'
read 'M-A'
read 'M-B'
read 'M-C'
read 'M-D'
read 'M-E'
read 'M-F'
read 'M-G'
read 'M-H'
read 'M-I'
read 'M-J'
read 'M-K'
read 'M-L'
read 'M-M'
read 'M-N'
read 'M-O'
read 'M-P'
read 'M-Q'
read 'M-R'
read 'M-S'
read 'M-T'
read 'M-U'
read 'M-V'
read 'M-W'
read 'M-X'
read 'M-Y'
read 'M-Z'
read 'M-['
read 'M-\'
read 'M-]'
read 'M-^'
read 'M-_'
read 'M-`'
read 'M-a'
read 'M-b'
read 'M-c'
read 'M-d'
read 'M-e'
read 'M-f'
read 'M-g'
read 'M-h'
read 'M-i'
read 'M-j'
read 'M-k'
read 'M-l'
read 'M-m'
read 'M-n'
read 'M-o'
read 'M-p'
read 'M-q'
read 'M-r'
read 'M-s'
read 'M-t'
read 'M-u'
read 'M-v'
read 'M-w'
read 'M-x'
read 'M-y'
read 'M-z'
read 'M-{'
read 'M-|'
read 'M-}'
read 'M-~'
read 'M-^?'
$ all256|while read -en 1 c; do  echo read "'$c'"; done|cat -vt
read ''
read '^A'
read '^B'
read '^C'
read '^D'
read '^E'
read '^F'
read '^G'
read '^H'
read ''
read ''
read '^K'
read '^L'
read '^M'
read '^N'
read '^O'
read '^P'
read '^Q'
read '^R'
read '^S'
read '^T'
read '^U'
read '^V'
read '^W'
read '^X'
read '^Y'
read '^Z'
read '^['
read '^\'
read '^]'
read '^^'
read '^_'
read ''
read '!'
read '"'
read '#'
read '$'
read '%'
read '&'
read '''
read '('
read ')'
read '*'
read '+'
read ','
read '-'
read '.'
read '/'
read '0'
read '1'
read '2'
read '3'
read '4'
read '5'
read '6'
read '7'
read '8'
read '9'
read ':'
read ';'
read '<'
read '='
read '>'
read '?'
read '@'
read 'A'
read 'B'
read 'C'
read 'D'
read 'E'
read 'F'
read 'G'
read 'H'
read 'I'
read 'J'
read 'K'
read 'L'
read 'M'
read 'N'
read 'O'
read 'P'
read 'Q'
read 'R'
read 'S'
read 'T'
read 'U'
read 'V'
read 'W'
read 'X'
read 'Y'
read 'Z'
read '['
read ']'
read '^'
read '_'
read '`'
read 'a'
read 'b'
read 'c'
read 'd'
read 'e'
read 'f'
read 'g'
read 'h'
read 'i'
read 'j'
read 'k'
read 'l'
read 'm'
read 'n'
read 'o'
read 'p'
read 'q'
read 'r'
read 's'
read 't'
read 'u'
read 'v'
read 'w'
read 'x'
read 'y'
read 'z'
read '{'
read '|'
read '}'
read '~'
read '^?'
read 'M-^@'
read 'M-^A'
read 'M-^B'
read 'M-^C'
read 'M-^D'
read 'M-^E'
read 'M-^F'
read 'M-^G'
read 'M-^H'
read 'M-^I'
read 'M-
'
read 'M-^K'
read 'M-^L'
read 'M-^M'
read 'M-^N'
read 'M-^O'
read 'M-^P'
read 'M-^Q'
read 'M-^R'
read 'M-^S'
read 'M-^T'
read 'M-^U'
read 'M-^V'
read 'M-^W'
read 'M-^X'
read 'M-^Y'
read 'M-^Z'
read 'M-^['
read 'M-^\'
read 'M-^]'
read 'M-^^'
read 'M-^_'
read 'M- '
read 'M-!'
read 'M-"'
read 'M-#'
read 'M-$'
read 'M-%'
read 'M-&'
read 'M-''
read 'M-('
read 'M-)'
read 'M-*'
read 'M-+'
read 'M-,'
read 'M--'
read 'M-.'
read 'M-/'
read 'M-0'
read 'M-1'
read 'M-2'
read 'M-3'
read 'M-4'
read 'M-5'
read 'M-6'
read 'M-7'
read 'M-8'
read 'M-9'
read 'M-:'
read 'M-;'
read 'M-<'
read 'M-='
read 'M->'
read 'M-?'
read 'M-@'
read 'M-A'
read 'M-B'
read 'M-C'
read 'M-D'
read 'M-E'
read 'M-F'
read 'M-G'
read 'M-H'
read 'M-I'
read 'M-J'
read 'M-K'
read 'M-L'
read 'M-M'
read 'M-N'
read 'M-O'
read 'M-P'
read 'M-Q'
read 'M-R'
read 'M-S'
read 'M-T'
read 'M-U'
read 'M-V'
read 'M-W'
read 'M-X'
read 'M-Y'
read 'M-Z'
read 'M-['
read 'M-\'
read 'M-]'
read 'M-^'
read 'M-_'
read 'M-`'
read 'M-a'
read 'M-b'
read 'M-c'
read 'M-d'
read 'M-e'
read 'M-f'
read 'M-g'
read 'M-h'
read 'M-i'
read 'M-j'
read 'M-k'
read 'M-l'
read 'M-m'
read 'M-n'
read 'M-o'
read 'M-p'
read 'M-q'
read 'M-r'
read 'M-s'
read 'M-t'
read 'M-u'
read 'M-v'
read 'M-w'
read 'M-x'
read 'M-y'
read 'M-z'
read 'M-{'
read 'M-|'
read 'M-}'
read 'M-~'
read 'M-^?'
$

Looks like $IFS characters and null become the empty string ''. The -e does not seem to change things. EOF is still handled the same.
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. Forum Support Area for Unregistered Users & Account Problems

Not able to post thread/reply to thread

Dear Moderator I am not able to post any new thread or post reply to mine old thread. Kindly help as i am stuck on one problem and needed suggestion. Regards Jaydeep (1 Reply)
Discussion started by: jaydeep_sadaria
1 Replies

2. Shell Programming and Scripting

Another Building Block, Binary File Manipulation...

Apologies for any typos, and IF this has been done before... This is yet another building block. The code generates a 256 byte binary file of _characters_ 0x00 to 0xFF for general usage and generates another binary file manipulated in a basic way. I need this facility for a kids project I am... (0 Replies)
Discussion started by: wisecracker
0 Replies

3. Shell Programming and Scripting

Convert binary file to csv and then back to the binary format

Hello *nix specialists, Im working for a non profit organisation in Germany to transport DSL over WLAN to people in areas without no DSL. We are using Linksys WRT 54 router with DD-WRT firmware There are at the moment over 180 router running but we have to change some settings next time. So my... (7 Replies)
Discussion started by: digidax
7 Replies

4. Programming

How to cancel a thread safely from the initial thread?

how about asynchronous canceling? or with signal? if with signal whether it effects the process? my english so badly :( :( (1 Reply)
Discussion started by: alan.zhao
1 Replies
Login or Register to Ask a Question