The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shell script that reads from configuration file to get database dolo21taf Shell Programming and Scripting 1 04-15-2008 07:47 PM
Shell script to read file into variable aspect_p Shell Programming and Scripting 7 03-21-2008 12:12 PM
Read variable from file in a C shell script haouesse Shell Programming and Scripting 2 11-07-2006 09:34 AM
Shell Script to read specific lines in a file varshanswamy Shell Programming and Scripting 5 08-22-2005 07:12 PM
script to read configuration file philip_dba Shell Programming and Scripting 1 04-05-2004 09:41 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-29-2008
nishanth hampal nishanth hampal is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 4
Unhappy How to read the configuration file from shell script

Hello all,
Please let me know if anyone have the idea how to read the configuration file from the shell script?

Thanks in advance,
Nishanth
  #2 (permalink)  
Old 01-29-2008
dennis.jacob dennis.jacob is offline Forum Advisor  
dj -------
  
 

Join Date: Feb 2007
Location: Cochin/Singapore
Posts: 515
Please provide a sample input (config) file and expected output..
  #3 (permalink)  
Old 01-29-2008
nishanth hampal nishanth hampal is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 4
The config file looks like below:

# This is the properties file which has the Hostaddress,instancecount,username and the password

HOST_ADDRESS = 180.144.226.47,180.144.226.35
USERNAME = pwdfre,kjhy
PASSWORD = hgfre,loiuy
INSTANCE_COUNT = 3,8

The individual entries i have to store in an array and then do operations on that.
  #4 (permalink)  
Old 01-29-2008
ennstate ennstate is offline
Registered User
  
 

Join Date: Mar 2007
Location: Chennai
Posts: 222
Try this,
Code:
sed -e '1i#!/bin/ksh' -e 's/,/ /g' -e 's/=//g' -e 's/\(.*\)/set -A \1/' /tmp/yourInput > /tmp/array_config.ksh
The above will create a ksh script with arrays.

You can use them,to list all the values contained in the array use ${HOST_ADDRESS[*]} format

Thanks
Nagarajan G
  #5 (permalink)  
Old 01-29-2008
nishanth hampal nishanth hampal is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 4
Retrieve files thru sftp

Can anyone help me out how to retrieve set of *.log files from a directory using shell script?
  #6 (permalink)  
Old 01-29-2008
ennstate ennstate is offline
Registered User
  
 

Join Date: Mar 2007
Location: Chennai
Posts: 222
Code:
for file in /your/dir/*.log ; do
 echo "Your processing goes here"
done
Thanks
Nagarajan G
  #7 (permalink)  
Old 01-29-2008
nishanth hampal nishanth hampal is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 4
how to store key value pairs(hash)in shell scripting

Please let me know how to store key value pairs and sort the keys of hash in shell scripting.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 07:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0