Standard utility to write stdin to a file with no stdout?

Solution 1:

There's the w command of sed:

sed -n 'w /tmp/out'

But perhaps you should just write your own script mycat:

#!/bin/bash
cat >"${1?}"

Create a directory ~/bin and add it to the front of your PATH so your command is found.

You may say, "but I use hundreds of machines, they won't have this script on them". In that case my suggestion is that you create a script that simply sets up your preferred environment on any machine you want. I have a script that will, ideally when I have root access, create a new user id, add a sudoers entry for it, copy some .bashrc and bin/* files, and so on. Then I can login under that id and "feel at home". Also, my command history is then not polluted by other admins doing root logins, and I am not doing all my commands as root.

I often have to work on brand new OS installations on hardware under test, and this sort of automatic setup is a real blessing.