5

Grep error in Bashscript

view full story
linux-howto

http://www.linuxquestions.org – While running bashscript i.e. checkdump I am getting error. Quote: #cat checkdump #!/bin/bash cd /dump_restore/outputs/dump/daily/ dt=date | awk '{print $2}' echo "########Checktime#######" ls -ltr | tail -1 | awk '{print "cat " $9}' | sh | grep $dt Output Quote: bash-3.00$ sh checkdump ########Checktime####### Usage: grep -hblcnsviw pattern file . . . bash-3.00$ Broken Pipe If i grep Jul instead of $dt, script works properly. (HowTos)