03-06-2007
dummie ksh
Please help me with a newbie ksh question:
I want a script in ksh (under Solaris 8 - SPARC) who runs a "ls -lR" command in some directory and it looks after all the files with the same date as the current one and/or created in the last 24 hours (or N hours).
The script should do:
- if no files with the same date were found display "no new files found..."
- otherwise display "new files found..." and also all the lines (only those lines from my "ls -lR" command)
and/or
the same for the files created in the last N hours.
I thought this is very easy but I encountered difficulties when I tried to avoid displaying files with the same day, month but not the same year...
BTW the part with "the same date" might be done in one line command?
Last edited by heartwork; 03-06-2007 at 09:29 PM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am trying to integrate a Digital Unix Alpha server in a LAN that contains several NT severs. Could someone give me some advise on how to integrate Alpha server, so I can contact the Alpha from any NT and visa versa. Thanks! (1 Reply)
Discussion started by: Rmeyvogel
1 Replies
2. UNIX for Dummies Questions & Answers
Since i have never seen one of these systems, i am just curious of how it looks. Btw if unix is not a GUI then is it possible to take a screenshots (4 Replies)
Discussion started by: Punk18
4 Replies
3. UNIX for Dummies Questions & Answers
Please help : I have a question i am just starting to study UNIX and i need some advice,as my teacher isn,t the helpful type.
I have just formatted my pc and partitioned it with win98 and winxp, do i need to create a partion for UNIX ??? OR is UNIX run in whatever partion i want it ????
Will... (6 Replies)
Discussion started by: DAFFYY30
6 Replies
4. UNIX for Dummies Questions & Answers
I'm writing a simple program in unix and was wondering how mid switch I can run a program and get someone to enter variables for it i.e.:
#!/bin/csh -f
echo "If you wish to do v press v"
echo "If you wish to compile press c"
echo "If you wish to add an entry press a"
echo "If you wish to... (1 Reply)
Discussion started by: RichardB
1 Replies
5. UNIX for Dummies Questions & Answers
what's the point of having loopback when you can just ping your local ip address? for example if my ip is 1.1.1.1, why can't i just do ping 5 1.1.1.1 instead of ping 5 127.0.1.1? it seems to me the only point in having it is for the sake of convenience? (2 Replies)
Discussion started by: jinduy
2 Replies
6. Linux
im a copletely newbie... i havent installed linux yet, but i wanna quit windows cuz i dont get it anymore... anything is better than this :mad: ... anyway...:
does linux runs all file extensions thats windows does? i mean, .doc, .exe, .bat, .psp, etc? i reallly dunno how it works...
normal... (3 Replies)
Discussion started by: guare_skt
3 Replies
7. UNIX for Dummies Questions & Answers
hi
i think this will make me seem dummier than most, actually i don't even understand most of the posts in the dummie section...
i have a project and i need to learn fortran programming, im working on a windows xp pc and so i have installed cygwin. and the cygwin site basically says learn unix so... (4 Replies)
Discussion started by: holyhive
4 Replies
8. UNIX for Dummies Questions & Answers
I know absolutely NOTHING about Unix but want to learn. How should I go about learning it? (1 Reply)
Discussion started by: Gosade
1 Replies
9. Shell Programming and Scripting
Hi
I am new to this Scripting process and would like to know How can i write a ksh script that will call other ksh scripts and write the output to a file and/or email.
For example
-------
Script ABC
-------
a.ksh
b.ksh
c.ksh
I need to call all three scripts execute them and... (2 Replies)
Discussion started by: pacifican
2 Replies
10. UNIX for Dummies Questions & Answers
Hi
I was installing 10.04. At 38 minutes remaining it froze and stayed that way for about 2 hours. I shut it down and now It's "frozen" for lack of a better term. ubuntu screen comes up, goes to black screen with blinking cursor.
Anyone?
Thanks!
---------- Post updated at 08:03 PM ----------... (1 Reply)
Discussion started by: martinnod
1 Replies
sttime(3) ShapeTools Toolkit Library sttime(3)
NAME
stMktime, stWriteTime - date and time handling
SYNOPSIS
#include <config.h>
#include <sttk.h.h>
time_tstMktime (char *string);
char*stWriteTime (time_t date);
DESCRIPTION
stMktime scans the given string and tries to read a date and time from it. It understands various formats of date strings. The following is
a list of all valid formats, optional parts in brackets.
[Tue] Jan 5[,] [19]93
This includes the standard asctime(3) format.
Jan 5 With no year given, the year defaults to the current year.
[19]93/01/05 This notation requires month and day represented by exactly two digits.
5.1.[19]93 This is the usual German notation.
5.1. German notation referencing the current year.
A certain time, given together with the date must always have the following form.
hours:minutes[:seconds]
Each of the fields must be an integer value within the proper range (hours: 0-23, minutes and seconds: 0-59). Values below
10 may be written as one digit numbers.
The time value may be placed anywhere in the date string: at the beginning, at the end, or somewhere in the middle. Any amount of white-
space may be given between a field of the time value and the separating colon. The time is always considered to be local time.
stWriteTime generates a time string similar to asctime(3) from its date argument.
SEE ALSO
asctime(3)
BUGS
Time Zone Names within the time string (like `MET') are not handled properly. In most cases they will cause a failure.
sttk-1.7 Thu Jun 24 17:43:35 1993 sttime(3)