Shell script | 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.

Shell script

Shell Programming and Scripting


Tags
unix, unix commands, unix scripting

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-28-2013
AraR87 AraR87 is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 9 July 2014, 8:05 AM EDT
Posts: 46
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 06-28-2013
Just Ice's Avatar
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 66 Times in 59 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 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
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 09:50 PM.