Searching for a file, with name Last Sunday through Saturday


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Searching for a file, with name Last Sunday through Saturday
# 1  
Old 03-19-2008
Searching for a file, with name Last Sunday through Saturday

Hi List,

I need write a script that looks for a file with name File_03-09_to_03-15_data.txt (File_LastSunday_to_LastSaturday_data.txt). If this file is not exists i have to look for a pervious weeks file like File_03-02_to_03-08_data.txt. This loop should continue untill it get a file or no file in the last 2 months.

Please share some logic. I am pretty new to shell scripting..

Thanks
RejiRaj
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Schedule the cron job for every 21day on saturday

Please guide me how to schedule the cron job to run on every Saturday at 6am with the interval of 21 days. (2 Replies)
Discussion started by: raghavendrajsv
2 Replies

2. Shell Programming and Scripting

Scheduling on every 2nd Saturday of a Month

Hi ! I need ur help on a UNIX scheduling Concept understanding : If I need to schedule a job (Say ETL Datastage job) through a shell script using the Cron function to make it run on every second saturday of every month, How can I do it ? :confused: (2 Replies)
Discussion started by: Ravichander
2 Replies

3. Shell Programming and Scripting

Run cron on every second Saturday ??

Hi, Can anyone help in editing CRON (OR) write a script to run another script every second saturday?? I tried to make use of DATE command to find the day but couldnt proceed further. your help is highly appreciated! Thanks, Mahi (11 Replies)
Discussion started by: mahi_mayu069
11 Replies

4. Shell Programming and Scripting

searching a file with a specified text without using conventional file searching commands

without using conventional file searching commands like find etc, is it possible to locate a file if i just know that the file that i'm searching for contains a particular text like "Hello world" or something? (5 Replies)
Discussion started by: arindamlive
5 Replies

5. Windows & DOS: Issues & Discussions

How to get next Saturday's 'Date'?

Hi am trying to get the upcoming Saturday date in the batch file. Kindly help ASAP. its urgent. :confused: (10 Replies)
Discussion started by: Zensar
10 Replies

6. UNIX for Advanced & Expert Users

How to scedule a script to be run on every second saturday in Month?

Hello Friends, In my project I have to schedule a script to be run on every second saturday (once in month). Can you please suggest what entry should I make in cron ? (5 Replies)
Discussion started by: sourabhsharma
5 Replies

7. Solaris

How to check for Saturday or Sunday

Hi , I have a date parameter passed in YYYYMMDD format , how can I check whether it is Sat or Sun on Solaris box , as we can do the same easily on linux box by using date -d YYYYMMDD '+a' . Any pointres will be really helpful . (5 Replies)
Discussion started by: harpreetanand
5 Replies

8. Shell Programming and Scripting

Check if a day eg: saturday is the Last saturday of the month!

Hi, I need to develop a script to check for the day. If the day is a Saturday then the script should check if the Saturday is the last Saturday of the month so that certain set of instruction can be executed is it is the last Saturday. I do not want to use the crontab as this needs to be part... (9 Replies)
Discussion started by: jobbyjoseph
9 Replies

9. Shell Programming and Scripting

Date - Last Sunday thru Saturday

Hi All, I have to kick off a script on every Monday to get some data from database for last week (Sunday thru Saturday). If its Monday (12/12/2005) Begin date will be Sunday - 12/4/2005 End date will be Saturday - 12/10/2005 The script might not kick off on some Mondays. So my... (2 Replies)
Discussion started by: skymirror
2 Replies
Login or Register to Ask a Question
dos2unix(1)						      General Commands Manual						       dos2unix(1)

NAME
dos2unix - DOS/MAC to UNIX text file format converter SYNOPSYS
dos2unix [options] [-c convmode] [-o file ...] [-n infile outfile ...] Options: [-hkqV] [--help] [--keepdate] [--quiet] [--version] DESCRIPTION
This manual page documents dos2unix, the program that converts plain text files in DOS/MAC format to UNIX format. OPTIONS
The following options are available: -h --help Print online help. -k --keepdate Keep the date stamp of output file same as input file. -q --quiet Quiet mode. Suppress all warning and messages. -V --version Prints version information. -c --convmode convmode Sets conversion mode. Simulates dos2unix under SunOS. -o --oldfile file ... Old file mode. Convert the file and write output to it. The program default to run in this mode. Wildcard names may be used. -n --newfile infile outfile ... New file mode. Convert the infile and write output to outfile. File names must be given in pairs and wildcard names should NOT be used or you WILL lost your files. EXAMPLES
Get input from stdin and write output to stdout. dos2unix Convert and replace a.txt. Convert and replace b.txt. dos2unix a.txt b.txt dos2unix -o a.txt b.txt Convert and replace a.txt in ASCII conversion mode. Convert and replace b.txt in ISO conversion mode. Convert c.txt from Mac to Unix ascii format. dos2unix a.txt -c iso b.txt dos2unix -c ascii a.txt -c iso b.txt dos2unix -c mac a.txt b.txt Convert and replace a.txt while keeping original date stamp. dos2unix -k a.txt dos2unix -k -o a.txt Convert a.txt and write to e.txt. dos2unix -n a.txt e.txt Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt. dos2unix -k -n a.txt e.txt Convert and replace a.txt. Convert b.txt and write to e.txt. dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Convert c.txt and write to e.txt. Convert and replace a.txt. Convert and replace b.txt. Convert d.txt and write to f.txt. dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt DIAGNOSTICS
BUGS
The program does not work properly under MSDOS in stdio processing mode. If you know why is that so, please tell me. AUTHORS
Benjamin Lin - <blin@socs.uts.edu.au> Bernd Johannes Wuebben (mac2unix mode) <wuebben@kde.org> MISCELLANY
Tested environment: Linux 1.2.0 with GNU C 2.5.8 SunOS 4.1.3 with GNU C 2.6.3 MS-DOS 6.20 with Borland C++ 4.02 Suggestions and bug reports are welcome. SEE ALSO
unix2dos(1) mac2unix(1) 1995.03.31 dos2unix v3.0 dos2unix(1)