thanx alot ghost dog..
and if i want the script to search through all the files in the director that is in..what should i change??
thanx alot ghost dog..
and if i want the script to search through all the files in the director that is in..what should i change??
i will leave it to you to try out. Its no fun if i do it for you. Here's a guide. Use a for loop to go through the files , read example 10-4 especially.
thanx a lot ghostdog
can i use this!! for the script to work in the pwd..Code:#!/bin/bash # list-glob.sh: Generating [list] in a for-loop, using "globbing" echo for file in * do .....
but then how can i make it to search the contents of all files..
i know i cant do it with find...what command should i use//?
sorry i am a ittle numb11
Code:read -p "what ?" vardate echo $vardate for files in *.ext do awk -v d="$vardate" '$0 ~ d{print}' $files read -p "Press enter to continue " done
its getting me an error..
Code:what ?28 28 Press enter to continue read: 8: arg count Press enter to continue read: 8: arg count Press enter to continue read: 8: arg count Sun Apr 20 19:12:28 BST 2008 Press enter to continue read: 8: arg count awk: read error (Is a directory) Press enter to continue read: 8: arg count Press enter to continue read: 8: arg count Press enter to continue read: 8: arg count
and is only getting numbers input...
Last edited by psychobeauty; April 24th, 2008 at 02:25 PM.
Well if you were writing a log parser in Python or Ruby, you can store the parsed data in an object oriented way. A nice re-usable library in Python in Ruby could go a long way, depending on your needs. Maybe later on he would want that output to go somewhere else, etc. I have no bash experience, so I can't speak for that (I skimmed the overview, and saw no object oriented section).
-Skeeterbug
it works for me.
Bookmarks