[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating strings of binary zero characters

From: david kerns
Subject: Re: Creating strings of binary zero characters
Date: Tue, 31 Aug 2021 09:08:18 -0700

probably better way, but this  shows you can...

echo hello | gawk -vL=20 'BEGIN {s=sprintf("%c", 0);for(i=0;i<L;i++)o=o
s;print o}{print}' > /tmp/padzero

On Tue, Aug 31, 2021 at 8:26 AM <> wrote:

> I have an application that needs to generate a header record in an
> otherwise
> text file where the header record has a key of binary zero characters in
> the
> first N bytes followed by normal text data like current date and other
> file-identifying information.
> Is there a way to generate a string of binary zero characters of length N
> using only gawk?  Or do I need to use another tool to accomplish that task?
> Peter

reply via email to

[Prev in Thread] Current Thread [Next in Thread]