Well the beauty of one-liners is that they're quick and dirty. They don't need to be portable, you don't usually maintain a one-liner for years. If you need something portable, you should use a real cross-platform language like Perl, Python, etc. Something that's independent of the OS you're running.