Skip to content

Instantly share code, notes, and snippets.

@kyab
Created May 21, 2011 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kyab/984613 to your computer and use it in GitHub Desktop.
Save kyab/984613 to your computer and use it in GitHub Desktop.
cot : let's pipe to CotEditor, like mate for TextMate.
#!/bin/bash
#pipe to cotEditor
#example:
# ls -alF | cot.sh
# man mount | col -b | cot.sh
file=`mktemp -t cot`
rm -f $file
cat - >> $file
open -a CotEditor $file
#echo "stdout is redirected to CotEditor"
#This does not work!!
#while read a; do
# echo -e $a >> $file
# echo -e \ttabbed >> $file
# echo -e \\ttabbed >> $file
#done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment