The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 05-09-2007
cjones cjones is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 3
Quote:
Originally Posted by anbu23
Code:
day=`date +%d`
dt=`date +%b`" "${day#0}
grep "$dt.*fail" filename
Thanks for the help... but when I cut/paste just those lines into a bourne shell script I get a 'bad substitution' error message. Here's my simple little script:

#!/bin/sh

day=`date +%d`
dt=`date +%b`" "${day#0}
grep "$dt.*fail" /var/adm/SYSLOG

I figure I'm missing something simple.

-chris