Discussion: Re: File re-format
Afficher un message
Vieux 17/08/2006, 23h01   #4
Chris F.A. Johnson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: File re-format

On 2006-08-17, bsh wrote:
>
> Chris F.A. Johnson wrote:
>> On 2006-08-17, bsh wrote:
>> > yuriy_zubarev wrote:

>> padding each line with spaces so that it's exactly 50 characters long.
>> > I'm surprised ... dd(1)

>> probably because it doesn't do what the OP asked for.

>
> I'm at the relative disadvantage of not being currently able to test
> my submission, but as I (re)read the OQ, this should do exactly
> what the OP asked for.
>
> So what do you think it does?


$ printf "%s\n" a b c d e f g > txt
$ dd if=txt bs=50 conv=block,noerror,sync | od -c
0+1 records in
1+0 records out
0000000 a \n b \n c \n d \n e \n f \n g \n \0 \0
0000020 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
*
0000060 \0 \0
0000062

--
Chris F.A. Johnson, author <http://cfaj.freeshell.org>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
  Réponse avec citation
 
Page generated in 0,06202 seconds with 9 queries