I'm trying to run a server that writes to $log (a txt file) and then find all the text in the logfile that starts with [1] and put it in another file. Here's my attempt. tee -a $log
works along with everything else. The grep command doesn't though.
run="tail -n0 -f -s 0.01 $cmds | (while true; do $tron --userconfigdir $userconfigdir --userdatadir $userdatadir --vardir $var; done) | tee -a $log | grep '^\[1\]' > ${var}logs/chatlogs.log"
What can be done to copy all the text from tee -a $log
starting with [1] to another file?