true.
but i was looking for basic shell tools. if portablity is not an issue 
perl can replace all shell tools as i think...
btw, a proper pack(), printf() in perl seems to be able to do any
thing of that sort

--- In [email protected], Cameron Simpson <[EMAIL PROTECTED]> wrote:
>
> On 18Jan2008 18:30, brusberri <[EMAIL PROTECTED]> wrote:
> | --- In [email protected], "Indika Bandara Udagedara" 
> | <indikabandara19@> wrote:
> | > hi say i want to write
> | > 10 bytes with values 1, 2, 3, ... to a file just like with fwrite 
> | how
> | > can i do with GNU tools
> | > 
> | > tried this for 1, ..., 10, 11, 
> | > echo 1 | dd of=out bs=1 count=1
> | > 
> | > but when it gets to 10, 11, ..
> | > only the first decimal place is written.
> | > 
> | > is there any way that i can pass a 1 byte int value to dd or some
> | > other tool?
> |
> | excuse me, i don't understand why you have to put bs=1
> | what do you need this for?
> 
> Because he wants to write _1_ byte. bs=1 * count=1 == 1 byte.
> 
> | btw are you writing to a raw device or to a formatted disk?
> 
> It probably doesn't matter for this. I think he's just writing to a
> regular file, actually.
> 
> I would use python or perl for this task, eg:
> 
>   perl -e 'printf("%c", 12)'
> 
> writes a single byte of value 12.
> -- 
> Cameron Simpson <[EMAIL PROTECTED]> DoD#743
> http://www.cskk.ezoshosting.com/cs/
> 
> C'est un Nagra.  C'est suisse, et tres, tres precis.    - _Diva_
>




To unsubscribe from this list, please email [EMAIL PROTECTED] & you will be 
removed. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/LINUX_Newbies/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/LINUX_Newbies/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to