1

grep to file outputs more than grep to screen?

view story
linux-howto

http://www.linuxquestions.org – When I execute unison tours 2> /dev/null | grep -A 2 '<-?->' on a bash prompt, I get the exact output i'm looking for: Quote: changed <-?-> changed Future Tours/File Clash Test.docx local : changed file modified on 2013-06-05 at 16:24:40 size 10221 rw-rw---- bj-server... : changed file modified on 2013-06-05 at 16:23:53 size 10232 rw-rw---- However when I put this into a shell script: Code: #!/bin/bash tmp=$(unison tours 2> /dev/null | grep -A 2 '<-?->') echo "$tmp" > /home/users/ (HowTos)