Solaris / OpenSolarisThis forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Thanks for the links. It did give me an idea of what I am trying to achieve.
But, I actually need some help scripting itself, meaning, how I put it in a script. If I can get some handhold in starting to write the script that will be great. If this is not the correct forum for that, please redirect me to the appropriate one. Thanks.
So rooms.out will contain only the rooms we care about right?
seems to me a simple
for i in `cat rooms.out` ; do echo `date` exam is being conducted in $i ; done > Exams.out
would work. if you want the date formatted do a man date and pick how you want.
I think a script that runs that code put in cron to run every half hour would be the perfect solution. the orginization of cron varies from distro to distro so we'll need to know what distro this is to help you with the cron entry
Not if there is a need to maintain the orig. timestamp for rooms that are in use for more than 1/2 hr. -- as implied by the example in the OP.
To my "Where are the timestamps in Exams.out coming from? Can they be re-generated at a later time?", maybe I should add: "Once determined, must they stay the same?"
Not if there is a need to maintain the orig. timestamp for rooms that are in use for more than 1/2 hr. -- as implied by the example in the OP.
To my "Where are the timestamps in Exams.out coming from? Can they be re-generated at a later time?", maybe I should add: "Once determined, must they stay the same?"
ah missed that ready for my next hack job?
for i in `cat rooms.out` ; do echo `date` exam is being conducted in $i ; done >> Exams_tmp.out
for i in `cat rooms.out` ; do grep $1 Exams_tmp.out | head -1 ; done > Exams.out
cp Exams.out Exams_tmp.out
Basic logic just in case you need some explaination...
We are appending the current list onto the Exams_tmp.out file (which would contain whatever was in the last round), then take the first instance we find and stick it in the Exams.out (earliest time stamp), then copy the Exams.out to Exams_tmp.out so we are ready next time the script runs.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.