Re: AWK in 4.X different from 5.X?
On Tue, 29 Mar 2005, Jonathan Chen wrote: which is equivalent to : date +"#%a %b - %d - %Y" Doing this within awk is another story.. Sorry. Got it. Originally I thought it was something to do from AWK. I tried the string you wrote from the command line and worked. I like your approach better. :-) Thanks. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: AWK in 4.X different from 5.X?
On Mon, Mar 28, 2005 at 10:21:24AM -0500, Francisco Reyes wrote: > On Mon, 28 Mar 2005, Jonathan Chen wrote: > > >On Sun, Mar 27, 2005 at 12:09:03PM -0500, Francisco Reyes wrote: > >>Since this was from a shell script I did > >>date | awk '{print "#"$1 " " $2 "-" $3 "-" $6}' > > > >How about: > > date +"#%a %b - %d - %Y" > > > Where/how do I put that? > I tried to put it inside the awk side, but didn't work. Eh? The command I was trying to replicate was: date | awk '{print "#"$1 " " $2 "-" $3 "-" $6}' which is equivalent to : date +"#%a %b - %d - %Y" Doing this within awk is another story.. Sorry. -- Jonathan Chen <[EMAIL PROTECTED]> -- Jesus saves. Allah forgives. Cthulu thinks you'd make a nice sandwich. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: AWK in 4.X different from 5.X?
On Mon, 28 Mar 2005, Jonathan Chen wrote: On Sun, Mar 27, 2005 at 12:09:03PM -0500, Francisco Reyes wrote: Since this was from a shell script I did date | awk '{print "#"$1 " " $2 "-" $3 "-" $6}' How about: date +"#%a %b - %d - %Y" Where/how do I put that? I tried to put it inside the awk side, but didn't work. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: AWK in 4.X different from 5.X?
On Sun, Mar 27, 2005 at 12:09:03PM -0500, Francisco Reyes wrote: > On Sun, 27 Mar 2005, Mario Hoerich wrote: > > >>Now I just wonder how to get date in my output. :-( > > > >Well, if nothing else helps there's always system("date"). > >However, you could also install lang/gawk. > > Since this was from a shell script I did > date | awk '{print "#"$1 " " $2 "-" $3 "-" $6}' How about: date +"#%a %b - %d - %Y" -- Jonathan Chen <[EMAIL PROTECTED]> -- char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);} ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: AWK in 4.X different from 5.X?
On Sun, 27 Mar 2005, Mario Hoerich wrote: Now I just wonder how to get date in my output. :-( Well, if nothing else helps there's always system("date"). However, you could also install lang/gawk. Since this was from a shell script I did date | awk '{print "#"$1 " " $2 "-" $3 "-" $6}' It works for my needs. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: AWK in 4.X different from 5.X?
# Francisco Reyes: [ strftime() not in 5.x-awk ] > > Now I just wonder how to get date in my output. :-( Well, if nothing else helps there's always system("date"). However, you could also install lang/gawk. HTH, Mario ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: AWK in 4.X different from 5.X?
On Sat, 26 Mar 2005, Christopher Nehren wrote: Probably because the awk on a 4.x machine is GNU awk, whereas the 5.x awk is the awk that comes straight from the horse's mouth, so to speak, and so thus hasn't been "extended" with GNUisms. Thanks. That makes sense. Now I just wonder how to get date in my output. :-( ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: AWK in 4.X different from 5.X?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2005-03-26, Francisco Reyes scribbled these curious markings: > Are the AWK in the 4.X branch and 5.X branch different? > Looking at > http://www.shelldorado.com/articles/awkcompat.html#os11 > > it seems the AWK in the 4.X branch has strftime. > I have 5.3 in my machine and AWK doesn't have that function. Probably because the awk on a 4.x machine is GNU awk, whereas the 5.x awk is the awk that comes straight from the horse's mouth, so to speak, and so thus hasn't been "extended" with GNUisms. Best Regards, Christopher Nehren -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.0 (FreeBSD) iD8DBQFCRaMVk/lo7zvzJioRAnIaAJ9PoqgjruOl1n4xaWupkR8It5yEcQCggK5H Kt/c44EQ2hKao69bzpjfqa0= =E616 -END PGP SIGNATURE- -- I abhor a system designed for the "user", if that word is a coded pejorative meaning "stupid and unsophisticated". -- Ken Thompson If you ask the wrong questions, you get answers like "42" and "God". Unix is user friendly. However, it isn't idiot friendly. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"