|
|
|
|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Korne Shell Script...
I am trying to write a Korne Shell Script, wherein the user is prompted for a date and a directory and then it starts searching recursively in this directory the list of all the files modified after the date chosen.
I wrote the following Script but it seems to be not working :- #!/usr/bin/ksh typeset DATE=`date +%d%m%y` echo "Enter a date (DDMMYY) and a directory.." read files Find "$dir’ -type f -name -mtime "$files" Anyone, please let me know the correct way. Thanks in advance. |
| Sponsored Links | ||
|
|
|
|||
|
ummmm...to fix the code
#!/usr/bin/ksh echo "Enter a date (YYMMDD) " read dte touch -t "$dte"0000 /tmp/$USER.ksh-search echo "Enter a directory.." read dir find $dir -type f -newer /tmp/$USER.ksh-search rm /tmp/$USER.ksh-search but really, i like porters suggestion better :-) |
|
|||
|
|
|
|||
|
Quote:
Code:
find "$dir" -type f -name "$files" -mtime +$N or you'll only find files exactly $N days old. He wants files that age or older if I read it correctly. |
| Sponsored Links |
|
|
![]() |
| Bookmarks |
| Tags |
| mtime |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Korne Shell... | marconi | Shell Programming and Scripting | 1 | 12-06-2007 02:01 PM |
| Some Problem with Korne Shell// | marconi | Shell Programming and Scripting | 4 | 12-06-2007 10:57 AM |
| Korne Shell Problem. | marconi | Shell Programming and Scripting | 3 | 12-05-2007 04:30 PM |
| GOTO LOOP in KORNE SHELL | DeepakXavier | Shell Programming and Scripting | 1 | 11-10-2005 12:47 PM |
| Mailing in Korne shell | DeepakXavier | Shell Programming and Scripting | 5 | 10-09-2005 05:27 PM |