Ksh Script help required...


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Ksh Script help required...
# 1  
Old 06-27-2008
Ksh Script help required...

Hi,

Can anyone please give me inputs to write a ksh script for the following :-

1. Load the configuration files "./app_config.txt" and "./mail_config.txt".
2. For each category there will be one input file in dir "data". Start
processing this input file based on the column 5th element (column) in
each record of the file, that record will be appended to corresponding
output file in "output" directory. e.g. If in the first row, 5th element
is "CP-NYM-01", the complete row would be entered/appended in the file
"output/CP-NYM-01.txt". Similarly all records containing "CP-NYM-01" in
the fifth Colum, from all input files, would be appended in a single "CP-
NYM-01.txt" file.
3. After all input files are processed, zip all the output files in "output"
directory.
4. Now send the files to respective email addresses mentioned in the config
file "./mail_config.txt".
5. If file category is not found in the file, send the remaining files to
common address "xyz@gmail.com".
6. Clean up the output directory after processing is complete.


Thanks a lot in advance,
Marconi.
# 2  
Old 07-03-2008
Hi,

At least please suggest me some other Forums where I can get replies.

Thanks a lot in advance.

Best Regards,
Marconi
# 3  
Old 07-03-2008
First you should break it into more simple questions.

How do I display the 5th element of a column? (and what is the delimiter for the columns btw!?)
How do I compare two strings?
How do I loop through each element in a list?
How do I send email?
etc.

You can find things like this all over google and if there is something more specific that you cant find anywhere you can ask here, because maybe people are too busy to make a complete script for you(at least I'm guessing they are Smilie ).

Cheers
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Perl Script:how to find how many parameters are required to run the script

How to find how many parameters are required to run a Perl script? (1 Reply)
Discussion started by: Lakshman_Gupta
1 Replies

2. Shell Programming and Scripting

Script required

Hey All, I am seeking for the script which will do as follows, 1) Login on one Unix server "Server1" 2) Want to access other Unix server "Server2", and want to get the information as, on one go. df -k /tmp df -k / df -k "any file system" 3) Re-direct the output to "space.txt" on... (12 Replies)
Discussion started by: ravinderkodan88
12 Replies

3. Shell Programming and Scripting

script required

This is the input file contents "data",9999,"data",999 "ddd"y"dat","dat","dart" 9999,999,999,"dat" 99,78,"duhu"yes"duhu" I need the output file contents "data",9999,"data",999 "dddydat","dat","dart" 9999,999,999,"dat" 99,78,"duhuyesduhu" Please use code tags when posting data and... (5 Replies)
Discussion started by: polineni
5 Replies

4. Shell Programming and Scripting

KSH script to run other ksh scripts and output it to a file and/or email

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

5. Shell Programming and Scripting

Help required to get a script

Hi Experts, I am very beginner in Bash Shell Scripting. Can anyone please guide me to create a script which should show the most busy file systems in sort basis as there are a lot of file systems on the server. I was told this task to be done by my IT lead and I must have to do this in... (3 Replies)
Discussion started by: naw_deepak
3 Replies

6. Shell Programming and Scripting

Getting required fields from a test file in required fromat in unix

My data is something like shown below. date1 date2 aaa bbbb ccccc date3 date4 dddd eeeeeee ffffffffff ggggg hh I want the output like this date1date2 aaa eeeeee I serached in the forum but didn't find the exact matching solution. Please help. (7 Replies)
Discussion started by: rdhanek
7 Replies

7. Shell Programming and Scripting

Script Required

Hello guys, Need a help.I have a flat file. QWER 2:35 7044 00001 ROUT 1188 EA SS ASD 2:36 7044 00010 ROUT BSD 2:37 7044 00011 ROUT END QWER 3:35 7044 00011 ROUT 1088 EA SS ASD 3:36 7044 00010 ROUT BSD 3:37 7044 00011 ROUT END QWER 2:35 7044 00001 ROUT 1188 EA SS ASD ... (1 Reply)
Discussion started by: Satadru
1 Replies

8. Shell Programming and Scripting

import var and function from ksh script to another ksh script

Ih all, i have multiples ksh scripts for crontab's unix jobs they all have same variables declarations and some similar functions i would have a only single script file to declare my variables, like: var1= "aaa" var2= "bbb" var3= "ccc" ... function ab { ...} function bc { ... }... (2 Replies)
Discussion started by: wolfhurt
2 Replies

9. Shell Programming and Scripting

tracing a ksh script within a ksh script

I normally trace a script with the ksh -x <script name> and redirect strderr to file. But if you have a script like the examble below...... vi hairy bear=`grep bear animals` if then ksh more_animals fi If I ksh -x hairy it won't trace "more_animals" unless I put a -x in it. Is... (1 Reply)
Discussion started by: shorty
1 Replies

10. Shell Programming and Scripting

executing a ksh script from another ksh script

Hi, I'm new to unix scripting.How can i call a script from another script. I have a.ksh and b.ksh .I have to call b.ksh from a.ksh after it is successfully exceuted. I tried using #!/bin/ksh -x in a.ksh and at the end i have used /path/b.ksh My problem is it is executing only a.ksh.it... (6 Replies)
Discussion started by: ammu
6 Replies
Login or Register to Ask a Question