awk question 
Author Message
 awk question

I want to take the output of a command from inside an awk file and have
the output of the command included in the output of the awk output.

Example:

I want to call the date command from within the awk program and have it
written to the file that I am creating
the output =

text
text
text
text
this was generated on "date"

any help appreciated
Thanks

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Fri, 24 Jan 2003 03:00:00 GMT  
 awk question

Quote:

> I want to take the output of a command from inside an awk file and have
> the output of the command included in the output of the awk output.

> Example:

> I want to call the date command from within the awk program and have it
> written to the file that I am creating
> the output =

> text
> text
> text
> text
> this was generated on "date"

> any help appreciated
> Thanks

> Sent via Deja.com http://www.deja.com/
> Before you buy.

awk '{print $0}END{printf "this was generated on ";system("date")}'
filename

I am assuming that you are using awk to process other lines in the
document.  If you are not then there are easier ways of doing this.  For
example:

date >> filename

Hope it helps
--
Cheers,
Ted J. Loeffelholz
Senior Design Engineer
Caterpillar Inc



Fri, 24 Jan 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Simple awk question

2. A Newbie AWK question

3. awk question

4. awk question about matching a pattern

5. AWK question

6. newbie awk question

7. awk questions !!!

8. Simple awk question

9. Easy Awk Question

10. Awk question.

11. awk Question

12. awk question

 

 
Powered by phpBB® Forum Software