by atesti · 15y ago · 0 comments
I've never used it, but I assume >() uses a command as though it were a writable file. So instead of history -a file writing to file, he does history -a >(logger) to write to the logger command. Seems pretty clever to me.
$ cat writer.sh
#!/bin/bash
if [[ "$#" == 1 ]]; then
echo "Wrote to file named $1" > "$1"
else
echo "Wrote to stdout"
fi
$ ./writer.sh
Wrote to stdout
$ ./writer.sh | cat
Wrote to stdout
$ ./writer.sh >(cat)
Wrote to file named /dev/fd/63