How to write bash shell script for mentioned requirement? | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

How to write bash shell script for mentioned requirement?

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-05-2012
Vineeta Nigam Vineeta Nigam is offline
Registered User
 
Join Date: Nov 2012
Last Activity: 9 December 2012, 3:52 PM EST
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Signal How to write bash shell script for mentioned requirement?

Hi All,

I am unable to write the script for the below requirement.

Requirement:
Main table dir_ancillary table contain three column "dir_ancillary.table_name"," dir_ancillary.text_file_name ", "dir_ancillary.Include" .
This dir_ancillary contain undefined tables in the column "dir_ancillary.table_name".

I need to write the script like the way- IF "dir_ancillary.Include" column contain 'Y' value for "dir_ancillary.table_name" then I need to unload all of the data for that dir_ancillary.table_name to a file name that is contained in dir_ancillary.text_file_name and include it in the Ancillary.zip file .


Please let me know how could it posibble to make it by Unix script becaue we have unlimited (not defined) tables in table_name column. It is dynamic .it could be 10 or 30,50 , 90. any number.


Please reply me.

Thanks Unix team for helping me.

Last edited by Corona688; 12-05-2012 at 10:34 AM..
Sponsored Links
    #2  
Old 12-05-2012
Skrynesaver's Avatar
Skrynesaver Skrynesaver is offline Forum Advisor  
Grumpy old geek
 
Join Date: Mar 2011
Last Activity: 18 September 2014, 6:36 AM EDT
Location: Éire
Posts: 815
Thanks: 20
Thanked 183 Times in 179 Posts
Which DB are the tables in and what CLI client do you use?

Is that client scriptable ?

The actual command will look something like

Code:
 
for i in $(db_client_select_column) 
  do 
  if [ $i ==  "Y" ]
    then db_dump_table_command
  fi
done

Sponsored Links
    #3  
Old 12-05-2012
Vineeta Nigam Vineeta Nigam is offline
Registered User
 
Join Date: Nov 2012
Last Activity: 9 December 2012, 3:52 PM EST
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Hi ,

Database is Informix database. sorry I didn't get CLI client. What is this ? Sorry I am new for Unix . I have to write the script to get the data from Informix database to Unix server.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to write a script for the below mentioned issue rajkumar_g Shell Programming and Scripting 0 10-07-2010 05:16 PM
How to write script in bash. alobi Homework & Coursework Questions 2 08-02-2010 06:44 AM
Can anybody write this bash script ? Cecko Shell Programming and Scripting 7 01-16-2009 11:41 AM
Required Shell script for My requirement ntgobinath Shell Programming and Scripting 3 05-01-2008 05:00 PM



All times are GMT -4. The time now is 01:49 AM.