# Please help me in writing my script

**URL:** <https://community.unix.com/t/please-help-me-in-writing-my-script/274256>\
**Category:** Shell Programming and Scripting\
**Created:** [September 28, 2010, 4:11am UTC](https://community.unix.com/t/please-help-me-in-writing-my-script/274256 "2010-09-28T04:11:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![baraghun](https://community.unix.com/letter_avatar/baraghun/32/6_22734026db12803ebb3e059622ac3534.png) [@baraghun](https://community.unix.com/u/baraghun)\
**Post date:** [September 28, 2010, 4:11am UTC](https://community.unix.com/t/please-help-me-in-writing-my-script/274256/1 "2010-09-28T04:11:41Z")

</div>

hello all,

I have a script, used to search for the strings from the set of 5 similar pattern file from the log dir. So here it goes . The input parameter is a part of the file name. When during the script execution, the script should parse the input parameter to original file's with the same pattern. Example Given below:

```nohighlight

./XMLsearch.sh CaseManagementService

```

This script reads from 3 input Files.

1st File: Where strings have been stored.  
2nd File: Where the File pattern are stored along with the original file-names & paths been defined , but this is not an archive files.  
3rd File: Contains File Patterns , along with the original filenames & paths been defined , but this is an archive files (gz) format.

```nohighlight

Content of 1st File

cat ${HOME}/config/stringFile.txt
414d51204450303141504420202020204c91dcdb2d7488c0

Content of 2nd File & 3rd File, Please check the attachment

```

Please do find the script attached with this, and guide me where shall input parameter should be parsed and how.

From the above syntax, the input parameter

```nohighlight
[CaseManagementServic] should be parsed and should search string
[414d51204450303141504420202020204c91dcdb2d7488c0]
in all the 5 CaseManagementService log file

/logs/production/App/tranlogs/CaseManagementService_Log1
/logs/production/App/tranlogs/CaseManagementService_Log2
/logs/production/App/tranlogs/CaseManagementService_Log3
/logs/production/App/tranlogs/CaseManagementService_Log4
/logs/production/App/tranlogs/CaseManagementService_Log5

```

Like this i have 100+ file patterns in the IN\_PUT FILE, whenever i run the script I use the part of the filename as an parameter which should be parsed and start searching in all 5 logs files associated with FILE\_Pattern as positioned in the files.

Can anybody please assist me on this., Any help will be appreciated....
