Sterilizing free space

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Tue Jan 3 19:28:48 UTC 2006


On Tue, Jan 03, 2006 at 09:20:12PM +0200, Peter wrote:
> yes "*empty"|dd of=/dev/hdx bs=16k
> 
> The string passed to yes must be literal (no escapes etc). If you need 
> to print something fancy try:
> 
> yes `echo -e "\xxx\yyy"`|dd of=...
> 
> The printf command on my system is broken (Debian). printf %c '\007' 
> prints '\' (should ring the bell).

printf supports \xxx sequences in the _format_ string only.  The shell
doesn't know to make '\007' into the character 0x07 and pass that.  So
printf sees the first character passed to it is '\' and prints that,
just as it should.

Both these work:
printf '\007'
printf '%c' ^V^G

Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list