Issue with parsing config variables


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Issue with parsing config variables
# 1  
Old 01-07-2010
Issue with parsing config variables

I am using MKS tool kit on windows server. One config variable is defined in windows environment and I am trying to use that variable.
Code:
# Below RootDir is defined in windows 

RootDir="\\f01\var"

# in unix script 

details="$RootDir/src|$RootDir/tgt"
src=`echo $details|awk -F '|'  '{print $1}'`

cd $src

root_dir has '\\' in it and because of this , derived variable 'src' is not getting resolved properly and I am getting error "system can not find the file specified"

Please help.
# 2  
Old 01-08-2010
Ad hoc:

Code:
[house@leonov] RootDir="\\f01\var"; 
               RootDir=$( echo "$RootDir" | sed 's/\\/\//g' ); 
               echo "$RootDir"
/f01/var

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to put variables commands in config files?

Hi All, Seeking for your assistance on how to put in variables all the commands in /bin config files: /home/test/config_file/config.cfg cat /home/test/config_file/config.cfg ECHO=/bin/echo LS=/bin/lsMain script cat test.sh source=/home/test/config_file/config.cfg ECHO=$ECHO LS=$LS#i... (3 Replies)
Discussion started by: znesotomayor
3 Replies

2. Shell Programming and Scripting

awk - is it possible to import variables from a config file?

hi, all. I got a question about awk: If I have a lot of awk files for different tasks, but they'll share the same base directory, log setting, action lists, etc., is it possible to import them from a config file, so that I don't have to put them into each awk file? For example, I need a... (8 Replies)
Discussion started by: lan9856
8 Replies

3. Shell Programming and Scripting

parsing a config file using bash

Hi , I have a config _file that has 3 columns (Id Name Value ) with many rows . In my bash script i want to be able to parse the file and do a mapping of any Id value so if i have Id of say brand1 then i can use the name (server5X) and Value (CCCC) and so on ... Id Name ... (2 Replies)
Discussion started by: nano2
2 Replies

4. Shell Programming and Scripting

Parsing Nagios service config files with awk

Hope someone can help, I've been pulling my hair out with this one... I've written a shell script that does a sanity check on our quite extensive Nagios configuration for anything that needs cleaning up but wouldn't make the Nagios daemon necessarily bork or complain. One section of the script... (2 Replies)
Discussion started by: vinbob
2 Replies

5. Shell Programming and Scripting

PERL on windows accessing variables from a config file

Folks, I'm a perl moron, so please speak very slowly. : ) I'm modifying a build script that starts up an apache server. Now there is a .config file that hardcodes an old webserver path like this c:\oldWebserver. Now I don't want that hardcoded value, rather wish to use an... (3 Replies)
Discussion started by: MarkoRocko
3 Replies

6. Shell Programming and Scripting

Parsing config-file (perl)

Hi, i'm trying to parse a config file that have alot of rows similar to this one: Example value value value What i want to do is to split and save the row above in a hash, like this: Example = value value value Basically i want to split on the first whitespace after the first... (3 Replies)
Discussion started by: mikemikemike
3 Replies

7. Shell Programming and Scripting

Parse config file and store the values in variables

Hi, I have a config file that has blank, commented lines. I need to escape commented lines, blank lines, parse the remaining lines and store them in variables or array. the config file contains the following lines. # config file # Define Oracle User ORA_USER=abcde ORA_PASS=xyzabc... (8 Replies)
Discussion started by: Lakshmi Chowdam
8 Replies

8. Shell Programming and Scripting

Need help parsing config file in ksh

Hi all, I've done some searching here but haven't found exactly what I'm looking for so I thought I'd post up and see if someone can help out. I'm working on a shell script that I would like to store environment variables in an external file. I'm familiar with sourcing a file with variables in... (1 Reply)
Discussion started by: kungfusnwbrdr
1 Replies

9. Shell Programming and Scripting

parsing config file to create new config files

Hi, I want to use a config file as the base file and parse over the values of country and city parameters in the config file and generate separate config files as explained below. I will be using the config file as mentioned below: (config.txt) country:a,b city:1,2 type:b1... (1 Reply)
Discussion started by: clazzic
1 Replies

10. Shell Programming and Scripting

Parsing config file

Hi All, I have a requirement to parse a file. Let me clear you all on the req. I have a job which contains multiple tasks and each task will have multiple attributes that will be in the below format. Each task will have some sequence number according to that sequence number tasks shld... (0 Replies)
Discussion started by: rajeshorpu
0 Replies
Login or Register to Ask a Question