How to create a 0-byte file in ksh.

This is probably obvious, but Google seems to have let me down. I need to create a file with a zero byte with arbitrary names on Unix (AIX, ksh). What is a good team that will do this. Something I can script, obviously.

Just to be clear, I'm not doing anything stupid. This is a script for generating specific test scripts. (Checking the correct behavior when processing files with 0 bytes.)

+5
source share
3 answers

Save keystrokes and unnecessary process, redirect:

$ > file
$ ls
file
+5
source

I get it.

touch $filename will do it.

+6
source

Use dd:

dd if=/dev/null of=zero.out bs=0 count=0
0
source

All Articles