ratox-nuggets

useful ratox related scripts
git clone git://git.2f30.org/ratox-nuggets
Log | Files | Refs | LICENSE

rat-textout (405B)


      1 #!/bin/sh
      2 check_if_dir
      3 test x"$1" = x"" && exit 1
      4 
      5 idstr="$1"
      6 textout="${idstr}/text_out"
      7 textin="${idstr}/text_in"
      8 history="${idstr}/history"
      9 namefile="name/out"
     10 
     11 touch "${history}"
     12 sob | tee -a "${history}" "${textin}" | while read -r msg; do
     13 	name=$(cat "${namefile}")
     14 	test x"$name" = x"" && name="Anonymous"
     15 	printf '%s : %s < %s\n' "`date +'%Y-%m-%d %H:%M'`" "${name}" "${msg}" >> "${textout}"
     16 done