Need Help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need Help
# 1  
Old 12-11-2008
Need Help

Hi one to All

I have written some script which will find the file in particular path
it dispalying the files, but i want date of the each file .

#!/bin/bash
echo -e "what is the keyword for your file to be searched? \n"
read file_keyword
echo "pleae enter the path where we can search the file? \n"
read path
echo "Here is your search output \n"
find "$path" -name "*${file_keyword}*"

o/p is

Here is your search output \n
/oracle/gtx/science_inc_1.txt
/oracle/gtx/science_inc_1.txt


but my req is it should dispaly the date with file

like

dec11 /oracle/gtx/science_inc_1.txt
dec12 /oracle/gtx/science_inc_1.txt

could you please help on this

thanks
saic
# 2  
Old 12-11-2008
Hammer & Screwdriver Perhaps along this thinking

Code:
> find . -name "file1*" -exec ls -l {} \; | tr -s " " | cut -d" " -f6,7,9
Oct 28 ./file11
Oct 28 ./file12
Oct 28 ./file13
Oct 28 ./file14
Oct 28 ./file14n
Oct 28 ./file15

# 3  
Old 12-11-2008
my req:

-rwxrwxrwx 1 gtx gtx 962 Dec 11 13:07 science1.txt
drwxrwxrwx 4 gtx gtx 2048 Dec 10 14:00 science0.txt
-rwxrwxrwx 1 gtx gtx 247 Dec 9 14:06 science00.txt
# 4  
Old 12-11-2008
Hammer & Screwdriver Then it is simpler

Something like the following; and I will leave it to you to adjust for your variables.

Code:
> find . -name "file1*" -exec ls -l {} \;

# 5  
Old 12-11-2008
thanks joeyg.

According to that it is giving my output.

thanks a lot
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question