> # 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.
>
>You almost have it :)
>
>grep `date +%b/%Y` file1 > file2
>
>The `` ticks say, "run this command and substitute the result RIGHT
>THERE" :) [ hows THAT for a non-technical explanation? :) ]
Pretty good. However, POSIX 1003.2 compliant shells (e.g., bash) allow
the use of $(date) as well as `date`. This has the advantage that it
can be nested:
head -1 $(foo $(bar))
This will run the "foo" command with 1 argument -- the result of the
"bar" command -- and return the top line of the resulting output.
Tet
--
``Live free or die; death is not the worst of evils'' - General George Stark
--------------------+--------------+----------------------------------------
[EMAIL PROTECTED] | Micro$oft: | Linux, the choice of a GNU generation.
[EMAIL PROTECTED] | Just say no! | See http://www.uk.linux.org for details