Can you explain to me what the below statement does. grep `date +%Y-%m-%d --date='1 day ago'` /path/to/file/FILE_PREFIX_\`date +%Y%m%d --date='1 day ago'`.dsv | grep -v 'ERROR' | cut -d | -f 2 | sed 's/^0/27/'
What Bash Statement does
bash
Suppose we have this file:$ cat path/to/file/FILE_PREFIX_20150730.dsv2015-07-29|01002015-07-30|02002015-07-30|03002015-07-31|0400Now observe what your command (slightly fixed) does:$ grep `date +%Y-%m-%d --date='1 day ago'` path/to/file/FILE_PREFIX_`date +%Y%m%d --date='1 day ago'`.dsv  | grep -v 'ERROR' | cut -d | -f 2 | sed 's/^0/27/'2720027300In short, it looks at a file whose name is based on yesterday's date, path/to/file/FILE_PREFIX_20150730.dsv.  It looks for any line in that file that mentions yesterday's date in the form 2015-07-30.  It then eliminates any line which also contains the characters ERROR. The remaining lines are divided into fields based on the character |.  The second field of the line is extracted.  If that second field starts with a zero, then the zero is replaced with 27.