This is probably a stupid question but I'm relatively new to this.  I'm
trying to grep the current date from file1 and redirect the output to
file2.  Right now I'm entering the current date as an argument on the
command line.  My macro file looks like this:

grep $1 file1 > file2

I would like to be able to run the macro without having to give it the
current date as an argument, I just don't know how to get grep to
understand the date command.  This is how I would like it to look:

grep date +"%b/%Y" file1 > file2

How do I enclose the [date +"%b/%Y"] command inside the grep command.  I
tried enclosing the date command within ",', {, and [ and none seemed to
work. 

I'm trying to do the same thing with a sed command by changing all dates
in a file to the current date. Right now my command looks like:

sed s/'[0123][0123456789]\/.*\/199[78]'/'18\/May\/1998'/g $1 > $2

I'd like to replace the '18\/May\/1998' with the date command.

 Any help would be greatly appreciated.

Thanks,
John

============================================
John Donaldson
Webmaster
Challenger Center for Space Science Education
www.challenger.org
[EMAIL PROTECTED]
============================================

Reply via email to