[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 176
  • Last Modified:

problem to read the file in directory from conf

I am facing a problem about read a file from the configuration file

configuration file name :-  config2010File.conf       it consist
"[config]
log=./log/processEDI.log
incomingdir=/v1/jing/edi/Incoming    <-- path
processdir=/v1/jing/edi/Processed
"

In my program need to read "incomingdir" to know the location to read the file. In incomingdir the file name always in different one.
Anyone have idea how to read it?

0
ryanW
Asked:
ryanW
  • 2
1 Solution
 
TintinCommented:
Assuming bash, based on your tags.


#!/bin/bash
CONFIG=/path/to/config2010File.conf

eval $(grep "^[a-z]" $CONFIG)
echo $incomingdir

Open in new window

0
 
TintinCommented:
The above solution will also give you access to $log and $processdir
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now