#!/bin/bash pf=/var/tmp/listen if [ -p $pf ]; then echo "Write your message, type Ctrl-D to quit:" cat > "$pf"; else echo "No one is listening."; fi