Xref: utzoo comp.unix.questions:29491 comp.unix.shell:1691 Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!sdd.hp.com!spool.mu.edu!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.questions,comp.unix.shell Subject: Re: Awk with passed parameters Keywords: awk bsd shell Message-ID: <1991Mar15.182242.18780@athena.mit.edu> Date: 15 Mar 91 18:22:42 GMT References: <3022@dsacg3.dsac.dla.mil> <1991Mar10.033553.28978@pilikia.pegasus.com> <55345@sequent.UUCP> Sender: news@athena.mit.edu (News system) Organization: Massachusetts Institute of Technology Lines: 31 In article <55345@sequent.UUCP>, lugnut@sequent.UUCP (Don Bolton) writes: |> I may be missing something obvious here but why use awk at all? |> |> IFS=': ' |> set `date` |> hrs=$4 |> m=$2 |> |> etc |> |> works just fine for a 12 hour clock display I use from the date output How does this solve the problem that the original poster is trying to solve? He wanted to use awk to filter the output of "ls" to print out only those files that were modified today. What you posted above explains how to set the month and day to shell variables. But how are you going to then use that to filter the output of ls? If you try to do it completely in the shell, you're going to have to pipe the output of ls into a loop or function that matches each line against the month and day. The matching will have to be done using "test" or "expr". Which means (unless you've got a shell with "test" built in) that you're going to be forking a process to do the test for every line in the ls listing. Is that really what you intended to suggest, or am I missing something? -- Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710