Sponsored Content
Top Forums UNIX for Advanced & Expert Users Another binary manipulation thread. Post 302848191 by wisecracker on Wednesday 28th of August 2013 05:44:10 PM
Old 08-28-2013
Hi DGPickett...
Quote:
Did you want to make the null more text friendly?
Yes and no. It is the only way I can get byte value zero into a string variable using only this default OSX install, as bash is not byte value zero friendly...

As for the xxd command, try and remove the file pointer after "done" and see what happens.
Try replacing it with say /dev/null too. I have absolutely no idea why /tmp/binary.file IS needed, but it is...

If you enter:-
Code:
echo -e -n "$text" > /tmp/somefilename

It will end up the same as /tmp/binary.file...

I have just had another idea.
Let me experiment and see if this idea works...

I will explain after some experimention what the idea is/was, whether successful or not, after I have tried it...
 

4 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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
copystr(9r)															       copystr(9r)

NAME
copystr - General: Copies a null-terminated character string with a specified limit SYNOPSIS
int copystr( char *s1, char *s2, u_int maxlength, u_int *ncopiedaddr ); ARGUMENTS
Specifies a pointer to a string (an array of characters terminated by a null character). Specifies a pointer to a buffer of at least maxlength characters. Specifies the maximum number of characters to copy. Specifies the address of an integer to receive the number of copied characters. DESCRIPTION
The copystr routine copies string s1 to the buffer pointed to by s2. The routine stops after copying a null character or after copying maxlength characters, whichever comes first. The s2 buffer is not padded with null characters to maxlength. The copystr routine returns the number of characters copied in the location pointed to by ncopiedaddr. Note that the character size is 1 byte. RETURN VALUES
Upon successful completion, copystr returns the value 0 (zero). Otherwise, it can return the following error: The string length, s1, exceeds the maximum number of characters, maxlength. SEE ALSO
Routines: bcopy(9r), blkclr(9r), ovbcopy(9r), strcpy(9r), strncpy(9r) copystr(9r)
All times are GMT -4. The time now is 12:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy