•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 427,430 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,632 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 1479 | Replies: 2
![]() |
•
•
Join Date: Apr 2006
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
i would like to find files that have been modified during a month. lets say i am type in 2004 06
it will find files in the month of june.
i know using l -la lista all the files and thier attrbutes. and one of thier attributtes is last modified time. can i somehow search for files using the modified time attrbute of the file
is there also a way to convert a numberic date to a textual date e.g. like
06 2006 to jun 2006
need help urgently
thanks
it will find files in the month of june.
i know using l -la lista all the files and thier attrbutes. and one of thier attributtes is last modified time. can i somehow search for files using the modified time attrbute of the file
is there also a way to convert a numberic date to a textual date e.g. like
06 2006 to jun 2006
need help urgently
thanks
•
•
Join Date: Apr 2006
Location: India
Posts: 16
Reputation:
Rep Power: 3
Solved Threads: 0
make a file with name of the month and the month in numeral format.
Say,
Jan 01
Feb 02
March 03
store the year and month in two different variable.
grep the month from the file containing the month and the corresponding number.
use awk to print the month name and year.
Do a ls -Ral and grep the month and year.
Try this out. It works.
Amit
Say,
Jan 01
Feb 02
March 03
store the year and month in two different variable.
grep the month from the file containing the month and the corresponding number.
use awk to print the month name and year.
Do a ls -Ral and grep the month and year.
Try this out. It works.
Amit
•
•
Join Date: Apr 2006
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
Originally Posted by problems
i would like to find files that have been modified during a month. lets say i am type in 2004 06
it will find files in the month of june.
i know using l -la lista all the files and thier attrbutes. and one of thier attributtes is last modified time. can i somehow search for files using the modified time attrbute of the file
is there also a way to convert a numberic date to a textual date e.g. like
06 2006 to jun 2006
need help urgently
thanks
You can use 'case' function to name the month parameter like
LEts suppose inside the script
$1-06
$2 - 2006
case $1 in
01)) month="Jan" ; break;;
02)) month="Feb" ; break;;
.
.
.
.
.
and then grep for the 'month' and year variable from the ls output.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Searching dll Files (Visual Basic 4 / 5 / 6)
- CPU usage 100%!!! (Windows NT / 2000 / XP / 2003)
- A question about deleting Temp files (Windows NT / 2000 / XP / 2003)
- hijacked! (Viruses, Spyware and other Nasties)
- Prog to list ASCII codes (beginners' stuff) (C)
- Newbie question about desktop problem (Windows NT / 2000 / XP / 2003)
- HijackThis log help (Viruses, Spyware and other Nasties)
- MSIEH - Ran Hijackthis - what do i do with the logfile? (Windows NT / 2000 / XP / 2003)
- can't find file size over 3 megabytes to clean up harddrive (Windows NT / 2000 / XP / 2003)
- >>>>>NEED HELP<<<< (Windows NT / 2000 / XP / 2003)
Other Threads in the Shell Scripting Forum
- Previous Thread: new to shell scripting, need some help
- Next Thread: doing a lookup script


Linear Mode