Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grep and Print Script

Status
Not open for further replies.

bigkid123

ISP
Nov 5, 2002
18
US
Hi,

I need help creating a script that will list files within a directory (/opt/actman/plm30/rpt) containing csbinv*.asc and phrinv*.asc. It should display the Date of the file and then allow the user to print a selected file.

Any help would be appreciated.

Thanks in advance.
 
What have you so far ?
Anyway:
Code:
man find
man ls
man read
man lp

Hope This Help
PH.
 
a=`ls -al /opt/actman/plm30/rpt|grep csbinv|print {$6,$7,$8"\t"$9}`
b=`ls -al /opt/actman/plm30/rpt|grep phrinv|print {$6,$7,$8"\t"$9}`

will get you the date and filename

echo $a
echo $b

Please confirm the following

Idealy you want all the output to be displayed like

1. 12 Aug 2003 file1
2. 13 Aug 2003 file2
3. 15 Aug 2003 file3

Please enter the report you would like printing ..

you could go further and ask which date(s) the user would like to see the reports for.

--
| Mike Nixon
| Unix Admin
|
----------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top