Shell script | Unix Linux Forums | Shell Programming and Scripting

  Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

Shell script

Shell Programming and Scripting


Tags
unix, unix commands, unix scripting

Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 06-28-2013
AraR87 AraR87 is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 19 March 2015, 6:28 AM EDT
Posts: 50
Thanks: 1
Thanked 2 Times in 2 Posts
Shell script

Guys,
Here is my requirement..
i have a cfg as below

Code:
 
example.cfg
LOG_PATH=/u/sample/sample.log
PATH=/u/sample/
MAIL=sample@gmail.com
ZIP_DAYS=7
PURGE_DAYS=30

LOG_PATH=/u/sample/sample.log
PATH=/u/sample/hello/test
MAIL=sample@gmail.com
ZIP_DAYS=5
PURGE_DAYS=25

here is my script logic..

I want to write a shell script to read these values using loop..Hope this can be done using stanzaget.

can anyone please give me some general script for this..

Thanks,

Last edited by Scott; 06-28-2013 at 06:50 AM.. Reason: Code tags
Sponsored Links
    #2  
Old Unix and Linux 06-28-2013
Just Ice's Unix or Linux Image
Just Ice Just Ice is offline Forum Advisor  
Lights on, brain off.
 
Join Date: Mar 2005
Last Activity: 20 September 2013, 10:59 AM EDT
Location: Philadelphia metro
Posts: 958
Thanks: 3
Thanked 67 Times in 60 Posts
see sample below ... note "." in front of filename on 2nd line ...

Code:
#! /bin/ksh
. /dir/example.cfg  # <-- read and import all values within example.cfg

..........
..........

exit 0

Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Correct shell script to Call One shell script from another shell script Vineeta Nigam Shell Programming and Scripting 5 12-07-2012 02:37 PM
call another shell script and pass parameters to that shell script sunrexstar Shell Programming and Scripting 2 11-29-2010 02:53 PM
How to use ssh execute other shell script on other host (shell script include nohup)? orablue Shell Programming and Scripting 1 11-18-2010 08:46 PM
invoking a shell script inside cgi shell script smriti_shridhar Shell Programming and Scripting 2 07-09-2008 01:50 AM
How to Run a shell script from Perl script in Parent shell? hifake Shell Programming and Scripting 16 08-28-2007 08:42 PM



All times are GMT -4. The time now is 02:32 AM.