Xref: utzoo comp.unix.questions:29272 comp.unix.shell:1633 Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!magnus.ircc.ohio-state.edu!tut.cis.ohio-state.edu!dsac.dla.mil!dsacg3.dsac.dla.mil!nfs1675 From: nfs1675@dsacg3.dsac.dla.mil ( Michael S Figg) Newsgroups: comp.unix.questions,comp.unix.shell Subject: Awk with passed parameters Keywords: awk bsd shell Message-ID: <3022@dsacg3.dsac.dla.mil> Date: 7 Mar 91 20:29:34 GMT Followup-To: poster Organization: Defense Logistics Agency Systems Automation Center, Columbus Lines: 22 I'm trying to write a short shell script using awk to list files in the current directory that have todays' date on them. It seems like something like this should work, but I haven't had any luck: set d = `date` ls -l | awk '$5 == x && $6 == y {print}' x=$d[2] y=$d[3] This in a C shell on a BSD machine where $5 is the month and $6 is the day. I've also tried this on a SVR3.2 machine with a Bourne shell and get similar results, usually that it can't open "Mar", which I'm assuming is coming from the 'x=$d[2]'. Any clues on what I'm doing wrong? I'm sure there are other ways to do this, but I'd like to get more familar with awk. ---Mike -- -------- o A herd of bagels | Michael Figg DSAC-FSD | | -- oo o o escaping from a deli. | DLA Systems Automation Center | | -- ooo oo Looking for Lox in | Cols, Ohio mfigg@dsac.dla.mil -------- o o all the wrong places | CIS: 73777,360