![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help needed please. | jerryboy78 | UNIX for Dummies Questions & Answers | 3 | 03-16-2008 10:06 AM |
| help needed | nnayagam | Shell Programming and Scripting | 2 | 03-07-2008 02:34 AM |
| Little help needed. | Netghost | AIX | 5 | 08-10-2006 11:29 AM |
| awk help needed. | cskumar | Shell Programming and Scripting | 0 | 07-20-2006 04:24 AM |
| Sed help needed | stevefox | Shell Programming and Scripting | 5 | 12-04-2005 09:44 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Help needed
Hi All,
I need help in writing a script. I need a script that takes a name as a parameter and executes the follwoing steps. The name will be like BUDGET01_BARE_DLY_YYYYMMDD, BUDGET02_BARE_DLY_YYYYMMDD etc. The YYYYMMDD represent today( systemdate). This names have to be passed as paramaters to the script and what it has to do is: 1. count the number of files for that name in the direcotry /opt/app ; for e.g for the file name BUDGET01_BARE_DLY_YYYYMMDD there will be 27 files with that name. if the number is less than 27 for BUDGET01_BARE_DLY_YYYYMMDD then through an error saying that not enough files for today. Then this has to happen to BUDGET02_BARE_DLY_YYYYMMDD similarly. If it has enough files then remove the last BARE_DLY_YYYYMMDD characters in the names. This has to occur recursively for different file names. Any help will be greatly appreciated. |
| Forum Sponsor | ||
|
|
|
|||
|
I am sorry I was not clear in my post. When i said i will have 27 files with that name for that day means the file name will be like below. The MKT represents 27 cities and hence I will have 27 files per day. For e.g if AUStralia is the market i have BUDGET01_TLG_DLY_<AUS>_<YYYYMMDD>.dat. For India i have BUDGET01_TLG_DLY_<IND>_<YYYYMMDD>.dat. There will be 27 files from different countries. I think I am clear in what I want now. I need to pass BUDGET01_yyyymmdd as parameter and continue to check if there are 27 files with that name otherwise I have to thruogh an error. This has to be done for BUDGET2 files also. Please help.
|
|||
| Google UNIX.COM |