#! /bin/bash

if [ $# -ne 1 ]; then
		echo "Usage: $0 identifier"
		exit 1
fi

trap 'rm -f "$1.pipe"; exit 0;' INT

mkfifo "$1.pipe"
exec 3<> "$1.pipe"

while true; do
		read req args

		if [ -n "$req" ]; then
				echo "$req" "$1" "$args" >mini-facebook.pipe
		fi
done 
