Visit Our UNIX and Linux User Community


Another binary manipulation thread.


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Another binary manipulation thread.
# 15  
Old 09-06-2013
Wel, in a null terminated string application, null is always '' the empty string, as it reterminates the string, just as a strcpy of a 5 byte plus null string into a 20 byte buffer initialized with 19 spaces and a null creates a string length of 5.

Now, is it the only character that is equal to '' the empty string? Does read differentiate that from EOF in a while read loop?
Code:
$ bash -c 'export ct=0 ; unset IFS ; all256|while read -rn 1 c
do
 echo "$(( ct++ )): '"'"'$c'"'"'"
done|cat -vt'
0: ''
1: '^A'
2: '^B'
3: '^C'
4: '^D'
5: '^E'
6: '^F'
7: '^G'
8: '^H'
9: ''
10: ''
11: '^K'
12: '^L'
13: '^M'
14: '^N'
15: '^O'
16: '^P'
17: '^Q'
18: '^R'
19: '^S'
20: '^T'
21: '^U'
22: '^V'
23: '^W'
24: '^X'
25: '^Y'
26: '^Z'
27: '^['
28: '^\'
29: '^]'
30: '^^'
31: '^_'
32: ''
33: '!'
34: '"'
35: '#'
36: '$'
37: '%'
38: '&'
39: '''
40: '('
41: ')'
42: '*'
43: '+'
44: ','
45: '-'
46: '.'
47: '/'
48: '0'
49: '1'
50: '2'
51: '3'
52: '4'
53: '5'
54: '6'
55: '7'
56: '8'
57: '9'
58: ':'
59: ';'
60: '<'
61: '='
62: '>'
63: '?'
64: '@'
65: 'A'
66: 'B'
67: 'C'
68: 'D'
69: 'E'
70: 'F'
71: 'G'
72: 'H'
73: 'I'
74: 'J'
75: 'K'
76: 'L'
77: 'M'
78: 'N'
79: 'O'
80: 'P'
81: 'Q'
82: 'R'
83: 'S'
84: 'T'
85: 'U'
86: 'V'
87: 'W'
88: 'X'
89: 'Y'
90: 'Z'
91: '['
92: '\'
93: ']'
94: '^'
95: '_'
96: '`'
97: 'a'
98: 'b'
99: 'c'
100: 'd'
101: 'e'
102: 'f'
103: 'g'
104: 'h'
105: 'i'
106: 'j'
107: 'k'
108: 'l'
109: 'm'
110: 'n'
111: 'o'
112: 'p'
113: 'q'
114: 'r'
115: 's'
116: 't'
117: 'u'
118: 'v'
119: 'w'
120: 'x'
121: 'y'
122: 'z'
123: '{'
124: '|'
125: '}'
126: '~'
127: '^?'
128: 'M-^@'
129: 'M-^A'
130: 'M-^B'
131: 'M-^C'
132: 'M-^D'
133: 'M-^E'
134: 'M-^F'
135: 'M-^G'
136: 'M-^H'
137: 'M-^I'
138: 'M-
'
139: 'M-^K'
140: 'M-^L'
141: 'M-^M'
142: 'M-^N'
143: 'M-^O'
144: 'M-^P'
145: 'M-^Q'
146: 'M-^R'
147: 'M-^S'
148: 'M-^T'
149: 'M-^U'
150: 'M-^V'
151: 'M-^W'
152: 'M-^X'
153: 'M-^Y'
154: 'M-^Z'
155: 'M-^['
156: 'M-^\'
157: 'M-^]'
158: 'M-^^'
159: 'M-^_'
160: 'M- '
161: 'M-!'
162: 'M-"'
163: 'M-#'
164: 'M-$'
165: 'M-%'
166: 'M-&'
167: 'M-''
168: 'M-('
169: 'M-)'
170: 'M-*'
171: 'M-+'
172: 'M-,'
173: 'M--'
174: 'M-.'
175: 'M-/'
176: 'M-0'
177: 'M-1'
178: 'M-2'
179: 'M-3'
180: 'M-4'
181: 'M-5'
182: 'M-6'
183: 'M-7'
184: 'M-8'
185: 'M-9'
186: 'M-:'
187: 'M-;'
188: 'M-<'
189: 'M-='
190: 'M->'
191: 'M-?'
192: 'M-@'
193: 'M-A'
194: 'M-B'
195: 'M-C'
196: 'M-D'
197: 'M-E'
198: 'M-F'
199: 'M-G'
200: 'M-H'
201: 'M-I'
202: 'M-J'
203: 'M-K'
204: 'M-L'
205: 'M-M'
206: 'M-N'
207: 'M-O'
208: 'M-P'
209: 'M-Q'
210: 'M-R'
211: 'M-S'
212: 'M-T'
213: 'M-U'
214: 'M-V'
215: 'M-W'
216: 'M-X'
217: 'M-Y'
218: 'M-Z'
219: 'M-['
220: 'M-\'
221: 'M-]'
222: 'M-^'
223: 'M-_'
224: 'M-`'
225: 'M-a'
226: 'M-b'
227: 'M-c'
228: 'M-d'
229: 'M-e'
230: 'M-f'
231: 'M-g'
232: 'M-h'
233: 'M-i'
234: 'M-j'
235: 'M-k'
236: 'M-l'
237: 'M-m'
238: 'M-n'
239: 'M-o'
240: 'M-p'
241: 'M-q'
242: 'M-r'
243: 'M-s'
244: 'M-t'
245: 'M-u'
246: 'M-v'
247: 'M-w'
248: 'M-x'
249: 'M-y'
250: 'M-z'
251: 'M-{'
252: 'M-|'
253: 'M-}'
254: 'M-~'
255: 'M-^?'
$

Too many aliases. Whatever is or defaults to IFS is indistinguishable from null:
Code:
$ bash -c 'export ct=0 IFS="
" ; all256|while read -ern 1 c
do
 echo "$(( ct++ )): '"'"'$c'"'"'"
done|cat -vt'
0: ''
1: '^A'
2: '^B'
3: '^C'
4: '^D'
5: '^E'
6: '^F'
7: '^G'
8: '^H'
9: '^I'
10: ''
11: '^K'
12: '^L'
13: '^M'
14: '^N'
15: '^O'
16: '^P'
17: '^Q'
18: '^R'
19: '^S'
20: '^T'
21: '^U'
22: '^V'
23: '^W'
24: '^X'
25: '^Y'
26: '^Z'
27: '^['
28: '^\'
29: '^]'
30: '^^'
31: '^_'
32: ' '
33: '!'
34: '"'
35: '#'
36: '$'
37: '%'
38: '&'
39: '''
40: '('
41: ')'
42: '*'
43: '+'
44: ','
45: '-'
46: '.'
47: '/'
48: '0'
49: '1'
50: '2'
51: '3'
52: '4'
53: '5'
54: '6'
55: '7'
56: '8'
57: '9'
58: ':'
59: ';'
60: '<'
61: '='
62: '>'
63: '?'
64: '@'
65: 'A'
66: 'B'
67: 'C'
68: 'D'
69: 'E'
70: 'F'
71: 'G'
72: 'H'
73: 'I'
74: 'J'
75: 'K'
76: 'L'
77: 'M'
78: 'N'
79: 'O'
80: 'P'
81: 'Q'
82: 'R'
83: 'S'
84: 'T'
85: 'U'
86: 'V'
87: 'W'
88: 'X'
89: 'Y'
90: 'Z'
91: '['
92: '\'
93: ']'
94: '^'
95: '_'
96: '`'
97: 'a'
98: 'b'
99: 'c'
100: 'd'
101: 'e'
102: 'f'
103: 'g'
104: 'h'
105: 'i'
106: 'j'
107: 'k'
108: 'l'
109: 'm'
110: 'n'
111: 'o'
112: 'p'
113: 'q'
114: 'r'
115: 's'
116: 't'
117: 'u'
118: 'v'
119: 'w'
120: 'x'
121: 'y'
122: 'z'
123: '{'
124: '|'
125: '}'
126: '~'
127: '^?'
128: 'M-^@'
129: 'M-^A'
130: 'M-^B'
131: 'M-^C'
132: 'M-^D'
133: 'M-^E'
134: 'M-^F'
135: 'M-^G'
136: 'M-^H'
137: 'M-^I'
138: 'M-
'
139: 'M-^K'
140: 'M-^L'
141: 'M-^M'
142: 'M-^N'
143: 'M-^O'
144: 'M-^P'
145: 'M-^Q'
146: 'M-^R'
147: 'M-^S'
148: 'M-^T'
149: 'M-^U'
150: 'M-^V'
151: 'M-^W'
152: 'M-^X'
153: 'M-^Y'
154: 'M-^Z'
155: 'M-^['
156: 'M-^\'
157: 'M-^]'
158: 'M-^^'
159: 'M-^_'
160: 'M- '
161: 'M-!'
162: 'M-"'
163: 'M-#'
164: 'M-$'
165: 'M-%'
166: 'M-&'
167: 'M-''
168: 'M-('
169: 'M-)'
170: 'M-*'
171: 'M-+'
172: 'M-,'
173: 'M--'
174: 'M-.'
175: 'M-/'
176: 'M-0'
177: 'M-1'
178: 'M-2'
179: 'M-3'
180: 'M-4'
181: 'M-5'
182: 'M-6'
183: 'M-7'
184: 'M-8'
185: 'M-9'
186: 'M-:'
187: 'M-;'
188: 'M-<'
189: 'M-='
190: 'M->'
191: 'M-?'
192: 'M-@'
193: 'M-A'
194: 'M-B'
195: 'M-C'
196: 'M-D'
197: 'M-E'
198: 'M-F'
199: 'M-G'
200: 'M-H'
201: 'M-I'
202: 'M-J'
203: 'M-K'
204: 'M-L'
205: 'M-M'
206: 'M-N'
207: 'M-O'
208: 'M-P'
209: 'M-Q'
210: 'M-R'
211: 'M-S'
212: 'M-T'
213: 'M-U'
214: 'M-V'
215: 'M-W'
216: 'M-X'
217: 'M-Y'
218: 'M-Z'
219: 'M-['
220: 'M-\'
221: 'M-]'
222: 'M-^'
223: 'M-_'
224: 'M-`'
225: 'M-a'
226: 'M-b'
227: 'M-c'
228: 'M-d'
229: 'M-e'
230: 'M-f'
231: 'M-g'
232: 'M-h'
233: 'M-i'
234: 'M-j'
235: 'M-k'
236: 'M-l'
237: 'M-m'
238: 'M-n'
239: 'M-o'
240: 'M-p'
241: 'M-q'
242: 'M-r'
243: 'M-s'
244: 'M-t'
245: 'M-u'
246: 'M-v'
247: 'M-w'
248: 'M-x'
249: 'M-y'
250: 'M-z'
251: 'M-{'
252: 'M-|'
253: 'M-}'
254: 'M-~'
255: 'M-^?'
$


Last edited by DGPickett; 09-06-2013 at 07:13 PM..
# 16  
Old 09-07-2013
You have whetted my apetite again... ;o)

There is possibly one _bug_ I can see in both my and your attempts is character 92, "\"
causing a pseudo escape on the next binary character it sees when running an
"somevar=echo -e......" into it more than once.

It also seems your 0x09 and 0x0A become NULL too.

I can understand why 0x0A _might_ occur but not 0x09, (Tab).
Quote:
Does read differentiate that from EOF in a while read loop?
On a binary file with single byte zero(s) uisng the default bash "read", yes, but on a
binary_string_variable, hmmm, hard to judge as placing byte zero into a variable is
not possible at this point.

Ignoring "read" FTTB I am going to try and force byte zero into the middlie of
a "Hello World." string, i.e. the space replaced with 0x00...

---------- Post updated 07-09-13 at 11:21 AM ---------- Previous update was 06-09-13 at 10:58 PM ----------

Hi DGPickett...
I tried this out from the command line and......
Code:
Last login: Sat Sep  7 10:17:43 on ttys000
AMIGA:barrywalker~> text="Hello World."
AMIGA:barrywalker~> text=${text/ /"\0"}
AMIGA:barrywalker~> echo ${#text}
13
AMIGA:barrywalker~> echo -n $text > /tmp/txt
AMIGA:barrywalker~> hexdump -C /tmp/txt
00000000  48 65 6c 6c 6f 5c 30 57  6f 72 6c 64 2e           |Hello\0World.|
0000000d
AMIGA:barrywalker~> echo -e -n $text > /tmp/txt
AMIGA:barrywalker~> hexdump -C /tmp/txt
00000000  48 65 6c 6c 6f 00 57 6f  72 6c 64 2e              |Hello.World.|
0000000c
AMIGA:barrywalker~> echo -e "$text"
HelloWorld.
AMIGA:barrywalker~> echo "$text"
Hello\0World.
AMIGA:barrywalker~> read newtext < /tmp/txt
AMIGA:barrywalker~> echo $newtext
Hello
AMIGA:barrywalker~> echo ${#newtext}
5
AMIGA:barrywalker~> # 0x00 always strips anything after it...
AMIGA:barrywalker~>
AMIGA:barrywalker~> echo -n $text > /tmp/txt
AMIGA:barrywalker~> read newtext < /tmp/txt
AMIGA:barrywalker~> echo $newtext
Hello0World.
AMIGA:barrywalker~> echo ${#newtext}
12
AMIGA:barrywalker~> hexdump -C /tmp/txt
00000000  48 65 6c 6c 6f 5c 30 57  6f 72 6c 64 2e           |Hello\0World.|
0000000d
AMIGA:barrywalker~> _

"read" has brought in the correct length of "Hello World.", 12, with the space shown as
character 0, but its file length is actually 13 characters in size...

So to return back to 13 characters again using pseudo-zero 2 backslashes will be needed
inside the file now making the file length 14.

This is a real killer for binary_string to file and back again manipulation.
I think the only way to account for binary zero is to use "\0" two characters and detect
those two characters inside the binary_string something like this...
Code:
if [ "${binary_string:$some_position:2}" == "\0" ]
then
        echo "\0 at position $some_position in binary string."
        # Do other binary string manipulation as required.
fi

The problem is that there may be two genuine independent "\" and "0" characters side
by side and not related to binary zero at all, just independent characters...

This is getting more difficult by the day... ;o)
# 17  
Old 09-17-2013
So, you can see shell is not a binary capable tool. Some bytes it can handle, but nulls, linefeeds, white space are problematic. But you can write trivial C to support it, like at tool that just does a tr of null to something else, trnull:
Code:
 
#include <stdio.h>
 
int main( int argc, char **argv ){
  int c ;
  if ( argc != 2 || strlen( argv[1] ) != 1 ){
    fputs(
"\n"
"Usage: trnull <byte_for_null>\n"
"\n"
"Translates null to <byte_for_null>, reading stdin and writing stdout.\n"
"\n", stderr );
    exit( 1 );
   }
  while ( EOF != ( c = getchar() )){
    if ( EOF == putchar( c ? c : argv[1][0] )){
      if ( ferror( stdout )){
        perror( "stdout" );
        exit( 2 );
       }
     }
   }
  if ( ferror( stdin )){
    perror( "stdin" );
    exit( 3 );
   }
 }
"mysrc/trnull.c" 31 lines, 541 characters 
$ mycc trnull
$ trnull
 
Usage: trnull <byte_for_null>
 
Translates null to <byte_for_null>, reading stdin and writing stdout.
 
$ all256|trnull '!'|od -bc
0000000   ! 001 002 003 004 005 006 007  \b  \t  \n 013  \f  \r 016 017
        041 001 002 003 004 005 006 007 010 011 012 013 014 015 016 017
0000020 020 021 022 023 024 025 026 027 030 031 032 033 034 035 036 037
        020 021 022 023 024 025 026 027 030 031 032 033 034 035 036 037
0000040       !   "   #   $   %   &   '   (   )   *   +   ,   -   .   /
        040 041 042 043 044 045 046 047 050 051 052 053 054 055 056 057
0000060   0   1   2   3   4   5   6   7   8   9   :   ;   <   =   >   ?
        060 061 062 063 064 065 066 067 070 071 072 073 074 075 076 077
0000100   @   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O
        100 101 102 103 104 105 106 107 110 111 112 113 114 115 116 117
0000120   P   Q   R   S   T   U   V   W   X   Y   Z   [   \   ]   ^   _
        120 121 122 123 124 125 126 127 130 131 132 133 134 135 136 137
0000140   `   a   b   c   d   e   f   g   h   i   j   k   l   m   n   o
        140 141 142 143 144 145 146 147 150 151 152 153 154 155 156 157
0000160   p   q   r   s   t   u   v   w   x   y   z   {   |   }   ~ 177
        160 161 162 163 164 165 166 167 170 171 172 173 174 175 176 177
0000200 200 201 202 203 204 205 206 207 210 211 212 213 214 215 216 217
        200 201 202 203 204 205 206 207 210 211 212 213 214 215 216 217
0000220 220 221 222 223 224 225 226 227 230 231 232 233 234 235 236 237
        220 221 222 223 224 225 226 227 230 231 232 233 234 235 236 237
0000240 240 241 242 243 244 245 246 247 250 251 252 253 254 255 256 257
        240 241 242 243 244 245 246 247 250 251 252 253 254 255 256 257
0000260 260 261 262 263 264 265 266 267 270 271 272 273 274 275 276 277
        260 261 262 263 264 265 266 267 270 271 272 273 274 275 276 277
0000300 300 301 302 303 304 305 306 307 310 311 312 313 314 315 316 317
        300 301 302 303 304 305 306 307 310 311 312 313 314 315 316 317
0000320 320 321 322 323 324 325 326 327 330 331 332 333 334 335 336 337
        320 321 322 323 324 325 326 327 330 331 332 333 334 335 336 337
0000340 340 341 342 343 344 345 346 347 350 351 352 353 354 355 356 357
        340 341 342 343 344 345 346 347 350 351 352 353 354 355 356 357
0000360 360 361 362 363 364 365 366 367 370 371 372 373 374 375 376 377
        360 361 362 363 364 365 366 367 370 371 372 373 374 375 376 377
0000400
$


Last edited by DGPickett; 09-17-2013 at 04:34 PM..
# 18  
Old 09-17-2013
Hi DGP...
Code:
0000000   ! 001 002 003 004 005 006 007  \b  \t  \n 013  \f  \r 016 017
        041 001 002 003 004 005 006 007 010 011 012 013 014 015 016 017
0000020 020 021 022 023 024 025 026 027 030 031 032 033 034 035 036 037
        020 021 022 023 024 025 026 027 030 031 032 033 034 035 036 037
0000040       !   "   #   $   %   &   '   (   )   *   +   ,   -   .   /
        040 041 042 043 044 045 046 047 050 051 052 053 054 055 056 057
0000060   0   1   2   3   4   5   6   7   8   9   :   ;   <   =   >   ?
        060 061 062 063 064 065 066 067 070 071 072 073 074 075 076 077

The problem is the same as mine, in that address 0x41 is also a(n) "!" so is this a binary zero or a real "!".
There is no way of knowing so I thought of using "@@" to substitute for binary zero as "\@" would present a similar problem as my "\0", but, would import into "read" easily.
But again "@@" may actually exist as real characters and not a substitution but at least it is starter approach to emulating binary zero...

I'll give it a whirl tomorrow...

HTH...
# 19  
Old 09-18-2013
All the 256 holes are always taken, so if your milieu does not have a limited character set, then you are right, the only escape is into longer strings for short characters, but then only context tells you that is the sort of file you have. That's why JAVA and xml use UTF-8 and label the content type. It started as a 'code page' discussion, a.k.a "what drum is on the printer".

There are apps for UNIX around that let you deal with image files like jpg and gif in text files of text numbers, like a decimal dump of a bmp file. I suppose if you run binary through the right dump you can then process it in shell back to a binary file.

Last edited by DGPickett; 09-18-2013 at 05:37 PM..
# 20  
Old 09-19-2013
Hi DGP...

Here is an idea using extended characters for 0x00, 0x0A and 0x1B that can easily be imported by the "read" command...
Code:
#!/bin/bash --posix
# Using OSX 10.7.5, bash default terminal...
# Alt-8 = • - zero...
bin_zero="•"
# Alt-7 =  - newline...
new_line=""
# Alt-6 =  - escape...
esc_char=""
# A simple string using •, , and  as a real binary substitutes.
#
echo $bin_zero"This is a binary "$bin_zero$new_line$esc_char" zero, newline and escape character cop-out."$esc_char$bin_zero$new_line > /tmp/bin.dat
# Check it and echo has included a newline character for added fun...
hexdump -C /tmp/bin.dat
#
read bin_text < /tmp/bin.dat
echo "$bin_text"
# Newline is stripped as expected...
#
# Now sawp extended characters into escape characters.
text=$(echo "$bin_text" | sed 's/•/\\0/g;s//\\n/g;s//\\\\/g')
# Done!
# Put escape charatcer version of string into a file.
echo -n "$text" > /tmp/newbin.dat
# Done!
# Check that escape charaters for _newline_ and zero exist.
hexdump -C /tmp/newbin.dat
echo "$text"
# Done
# Now resave to the real file with binary 0x00s and 0x0A.
echo -e -n "$text" > /tmp/newbin.dat
# Done
# Prove it exists.
hexdump -C /tmp/newbin.dat
echo "Now converted to binary using extended characters..."
# Yup, it does...

The results:-
Code:
Now converted to binary using extended characters...
AMIGA:barrywalker~> ./bin_test.sh
00000000  e2 80 a2 54 68 69 73 20  69 73 20 61 20 62 69 6e  |...This is a bin|
00000010  61 72 79 20 e2 80 a2 c2  b6 c2 a7 20 7a 65 72 6f  |ary ....... zero|
00000020  2c 20 6e 65 77 6c 69 6e  65 20 61 6e 64 20 65 73  |, newline and es|
00000030  63 61 70 65 20 63 68 61  72 61 63 74 65 72 20 63  |cape character c|
00000040  6f 70 2d 6f 75 74 2e c2  a7 e2 80 a2 c2 b6 0a     |op-out.........|
0000004f
•This is a binary • zero, newline and escape character cop-out.•
00000000  5c 30 54 68 69 73 20 69  73 20 61 20 62 69 6e 61  |\0This is a bina|
00000010  72 79 20 5c 30 5c 6e 5c  5c 20 7a 65 72 6f 2c 20  |ry \0\n\\ zero, |
00000020  6e 65 77 6c 69 6e 65 20  61 6e 64 20 65 73 63 61  |newline and esca|
00000030  70 65 20 63 68 61 72 61  63 74 65 72 20 63 6f 70  |pe character cop|
00000040  2d 6f 75 74 2e 5c 5c 5c  30 5c 6e                 |-out.\\\0\n|
0000004b
\0This is a binary \0\n\\ zero, newline and escape character cop-out.\\\0\n
00000000  00 54 68 69 73 20 69 73  20 61 20 62 69 6e 61 72  |.This is a binar|
00000010  79 20 00 0a 5c 20 7a 65  72 6f 2c 20 6e 65 77 6c  |y ..\ zero, newl|
00000020  69 6e 65 20 61 6e 64 20  65 73 63 61 70 65 20 63  |ine and escape c|
00000030  68 61 72 61 63 74 65 72  20 63 6f 70 2d 6f 75 74  |haracter cop-out|
00000040  2e 5c 00 0a                                       |.\..|
00000044
Now converted to binary using extended characters...
AMIGA:barrywalker~>

EDIT:

I didn't want to use "sed" but longhand became a large program and defeated the object...

Noticed a minor bug and squashed it...

Last edited by wisecracker; 09-19-2013 at 06:26 PM.. Reason: See above...
# 21  
Old 09-19-2013
Whenever you escape null to \0 you must minimally escape \ to \\. IFS has to have one character in it, so if you put in newline only, \n, a utility that escaped just those three would make data shell friendly.
Code:
 
#include <stdio.h>
void p_putchar( int c ){
  if ( EOF == putchar( c )){
    if ( ferror( stdout )){
      perror( "stdout" );
      exit( 1 );
     }
    exit( 0 );
   }
 }
int main  (){
  int c ;
  while ( EOF != ( c = getchar() )){
    switch ( c ){
    case '\\':
      p_putchar( c );
      break ;
    case '\0':
      p_putchar( '\\' );
      c = '0' ;
      break ;
    case '\n':
      p_putchar( '\\' );
      c = 'n' ;
      break ;
    default:
      break ;
    }
    p_putchar( c );
   }
  if ( ferror( stdin )){
    perror( "stdin" );
    exit( 2 );
   }
 }
 
 
 
 
 
 
$ all256|bin2txt|od -bc
0000000   \   0 001 002 003 004 005 006 007  \b  \t   \   n 013  \f  \r
        134 060 001 002 003 004 005 006 007 010 011 134 156 013 014 015
0000020 016 017 020 021 022 023 024 025 026 027 030 031 032 033 034 035
        016 017 020 021 022 023 024 025 026 027 030 031 032 033 034 035
0000040 036 037       !   "   #   $   %   &   '   (   )   *   +   ,   -
        036 037 040 041 042 043 044 045 046 047 050 051 052 053 054 055
0000060   .   /   0   1   2   3   4   5   6   7   8   9   :   ;   <   =
        056 057 060 061 062 063 064 065 066 067 070 071 072 073 074 075
0000100   >   ?   @   A   B   C   D   E   F   G   H   I   J   K   L   M
        076 077 100 101 102 103 104 105 106 107 110 111 112 113 114 115
0000120   N   O   P   Q   R   S   T   U   V   W   X   Y   Z   [   \   \
        116 117 120 121 122 123 124 125 126 127 130 131 132 133 134 134
0000140   ]   ^   _   `   a   b   c   d   e   f   g   h   i   j   k   l
        135 136 137 140 141 142 143 144 145 146 147 150 151 152 153 154
0000160   m   n   o   p   q   r   s   t   u   v   w   x   y   z   {   |
        155 156 157 160 161 162 163 164 165 166 167 170 171 172 173 174
0000200   }   ~ 177 200 201 202 203 204 205 206 207 210 211 212 213 214
        175 176 177 200 201 202 203 204 205 206 207 210 211 212 213 214
0000220 215 216 217 220 221 222 223 224 225 226 227 230 231 232 233 234
        215 216 217 220 221 222 223 224 225 226 227 230 231 232 233 234
0000240 235 236 237 240 241 242 243 244 245 246 247 250 251 252 253 254
        235 236 237 240 241 242 243 244 245 246 247 250 251 252 253 254
0000260 255 256 257 260 261 262 263 264 265 266 267 270 271 272 273 274
        255 256 257 260 261 262 263 264 265 266 267 270 271 272 273 274
0000300 275 276 277 300 301 302 303 304 305 306 307 310 311 312 313 314
        275 276 277 300 301 302 303 304 305 306 307 310 311 312 313 314
0000320 315 316 317 320 321 322 323 324 325 326 327 330 331 332 333 334
        315 316 317 320 321 322 323 324 325 326 327 330 331 332 333 334
0000340 335 336 337 340 341 342 343 344 345 346 347 350 351 352 353 354
        335 336 337 340 341 342 343 344 345 346 347 350 351 352 353 354
0000360 355 356 357 360 361 362 363 364 365 366 367 370 371 372 373 374
        355 356 357 360 361 362 363 364 365 366 367 370 371 372 373 374
0000400 375 376 377
        375 376 377
0000403
$

Forgot the exit(0) for no error stdout EOF last time!

Last edited by DGPickett; 09-19-2013 at 05:44 PM..

Previous Thread | Next Thread
Test Your Knowledge in Computers #475
Difficulty: Medium
A Yottabyte (YB) equals 1,208,925,819,614,629,174,706,176 bytes.
True or False?

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

Featured Tech Videos