LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-08-2005, 07:31 PM   #1
Apostasy
Member
 
Registered: Jun 2004
Location: Wisconsin
Distribution: Ubuntu
Posts: 31

Rep: Reputation: 15
Talking shell script help


hello its me again
i had such good luck posting the original question i thought i'd return with a new one
ok this time i need something to print the contents of a directory to an html file..

dir listing as follows:
dir1
dir2
dir3
dir4

need to print like this:
Code:
[Jan 3]
06:30 dir4
[Jan 1]
11:01 dir3
09:15 dir2
[Dec 20]
01:46 dir1
also when any folder's last modified time reaches > 1 week old it needs to be moved to ../different_folder
i have a cron job running a shell script hourly but it only lists the folder names in order with no date info.. kinda hard to keep track of updates.. i would really like the html file to have the above format instead.. and also to move older folders automagically.. would be awesome!
Many thanks in advance

-Pos
 
Old 04-09-2005, 04:41 PM   #2
ahh
Member
 
Registered: May 2004
Location: UK
Distribution: Gentoo
Posts: 293

Rep: Reputation: 31
This should provide the listing you require:-
Code:
ls -goct | grep "^d" | awk '{ print "["$4" " $5"]\n" $6" " $7 }' | cat -n | sort -k 2 | uniq -s 9 | sort | cut -f 2
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script inside shell script treotan Linux - General 4 02-19-2009 06:34 AM
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 02:14 AM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
Directory listing - Calling shell script from a CGI script seran Programming 6 08-11-2005 11:08 PM
[SHELL SCRIPT] Write at the right of the shell window Creak Linux - General 2 04-02-2004 03:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration