Hello Ann:<br><br>man (g)awk   <br><br>:-)<br><br>awk -v | --assign  <internal variable name>=<variable value> <other awk options and stuff><br><br><br>Not quite sure what you want to do do.  Can you show the resulting output or be a bit more specific.
<br><br><br>Regards,<br>Lou<br><div class="gmail_quote">On Nov 22, 2007 12:55 PM, ann kok <<a href="mailto:annkok2001@yahoo.com">annkok2001@yahoo.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Lou<br><br>Thank you very much<br><br>One more question. how can I put the CGA number as<br>variable?<br><br>eg: CGA001, CGA002..... when<br>i run the program<br><br>awk -v CGA=`for loop` program.awk file.txt<br><br>or any way to do it?
<br><div class="Ih2E3d"><br>Thank you again<br><br><br><br>BEGIN { RS = "\n" ; FS = "|" }<br>{<br></div>print "File No.: CGA001<br><div><div></div><div class="Wj3C7c">print ""<br>}<br><br>
<br>--- Lou Spironello <<a href="mailto:lspironello@gmail.com">lspironello@gmail.com</a>> wrote:<br><br>> awk -v HST=`hostname` -f program.awk file.txt<br>><br>> inside program.awk<br>> use:<br>><br>>   printf "from: %s\n",HST
<br>><br>> Regards,<br>> Lou<br>><br>> On Nov 21, 2007 3:41 PM, ann kok<br>> <<a href="mailto:annkok2001@yahoo.com">annkok2001@yahoo.com</a>> wrote:<br>><br>> > Thank you<br>> ><br>> > but i don't know how to put the hostname in awk
<br>> > program<br>> ><br>> > eg: my program is "program.awk<br>> ><br>> > awk -f program.awk file.txt<br>> ><br>> > Thank you again<br>> ><br>> > BEGIN { RS = "\n" ; FS = "|" }
<br>> ><br>> >  {<br>> > print "Name:", $9<br>> > print "Created: `date`"<br>> > print "from: `hostname`"<br>> > print ""<br>> > }<br>> >
<br>> ><br>> > --- Lou Spironello <<a href="mailto:lspironello@gmail.com">lspironello@gmail.com</a>> wrote:<br>> ><br>> > > Hope this helps.<br>> > ><br>> > > echo "test" | awk -v mydate=`date +%Y%m%d`
<br>> '{printf<br>> > > "standard input is<br>> > > %s\nmy variable value is %s\n",$1,mydate}'<br>> > ><br>> > > :-)<br>> > ><br>> > ><br>> > > Regards,
<br>> > > Lou<br>> > ><br>> > > On Nov 21, 2007 12:22 PM, ann kok<br>> > > <<a href="mailto:annkok2001@yahoo.com">annkok2001@yahoo.com</a>> wrote:<br>> > ><br>> > > > Hi all
<br>> > > ><br>> > > > how can I print date in this date format?<br>> 20071122<br>> > > ><br>> > > > Can command "date, hostname" run in awk<br>> program<br>
> > > > itself?<br>> > > ><br>> > > > program.awk<br>> > > ><br>> > > >     BEGIN { RS = "\n" ; FS = "|" }<br>> > > ><br>> > > >     {
<br>> > > >           print "Name:", $9<br>> > > >           print "Created: `date`"<br>> > > >           print "from: `hostname`"<br>> > > >           print ""
<br>> > > >     }<br>> > > ><br>> > > > Thank you<br>> > > ><br>> > > ><br>> > > ><br>> > > ><br>> > ><br>> ><br>> >
<br>><br>____________________________________________________________________________________<br>> > > > Be a better pen pal.<br>> > > > Text or chat with friends inside Yahoo! Mail.<br>> See
<br>> > > how.<br>> > > > <a href="http://overview.mail.yahoo.com/" target="_blank">http://overview.mail.yahoo.com/</a><br>> > > ><br>> > > > --<br>> > > > fedora-list mailing list
<br>> > > > <a href="mailto:fedora-list@redhat.com">fedora-list@redhat.com</a><br>> > > > To unsubscribe:<br>> > ><br>> <a href="https://www.redhat.com/mailman/listinfo/fedora-list" target="_blank">
https://www.redhat.com/mailman/listinfo/fedora-list</a><br>> > > ><br>> > > > --<br>> > > fedora-list mailing list<br>> > > <a href="mailto:fedora-list@redhat.com">fedora-list@redhat.com
</a><br>> > > To unsubscribe:<br>> ><br>> <a href="https://www.redhat.com/mailman/listinfo/fedora-list" target="_blank">https://www.redhat.com/mailman/listinfo/fedora-list</a><br>> ><br>> ><br>
> ><br>> ><br>> ><br>><br>____________________________________________________________________________________<br>> > Get easy, one-click access to your favorites.<br>> > Make Yahoo! your homepage.
<br>> > <a href="http://www.yahoo.com/r/hs" target="_blank">http://www.yahoo.com/r/hs</a><br>> ><br>> > --<br>> > fedora-list mailing list<br>> > <a href="mailto:fedora-list@redhat.com">fedora-list@redhat.com
</a><br>> > To unsubscribe:<br>> <a href="https://www.redhat.com/mailman/listinfo/fedora-list" target="_blank">https://www.redhat.com/mailman/listinfo/fedora-list</a><br>> ><br></div></div>> > --<br><div class="Ih2E3d">
> fedora-list mailing list<br>> <a href="mailto:fedora-list@redhat.com">fedora-list@redhat.com</a><br>> To unsubscribe:<br><a href="https://www.redhat.com/mailman/listinfo/fedora-list" target="_blank">https://www.redhat.com/mailman/listinfo/fedora-list
</a><br><br><br><br></div>      ____________________________________________________________________________________<br><div><div></div><div class="Wj3C7c">Be a better pen pal.<br>Text or chat with friends inside Yahoo! Mail. See how.  
<a href="http://overview.mail.yahoo.com/" target="_blank">http://overview.mail.yahoo.com/</a><br><br>--<br>fedora-list mailing list<br><a href="mailto:fedora-list@redhat.com">fedora-list@redhat.com</a><br>To unsubscribe: 
<a href="https://www.redhat.com/mailman/listinfo/fedora-list" target="_blank">https://www.redhat.com/mailman/listinfo/fedora-list</a><br></div></div></blockquote></div><br>