>>885
無理やりperlで答えると、File::Specのdevnull使え。

devnull
Returns a string representation of the null device.

$devnull = File::Spec->devnull();