Results 1 to 1 of 1
Hi everyone,
I have a file named access.txt with the following content.
productsLocation=/inets/wily
appServerJavaBinLocation=/inets/bea/j2sdk1.4.2_18/bin
I want to navigate my way in to the "products location" directory using a script.
So,I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-14-2009 #1Just Joined!
- Join Date
- Dec 2009
- Posts
- 1
Frustrating problem with awk
Hi everyone,
I have a file named access.txt with the following content.
productsLocation=/inets/wily
appServerJavaBinLocation=/inets/bea/j2sdk1.4.2_18/bin
I want to navigate my way in to the "products location" directory using a script.
So,I used the below command to extract the value:
path=`cat access.txt | grep productsLocation | sed 's_=_& _' | awk '{print $2}'`
cd $path
But while executing the cd command I'm getting the below error:
: No such file or directory
When I try to echo the contents of $path,below is the content
#echo $path
/inets/wily
I believe the problem is with awk not treating the output as a directory. Please help me on this.Thanks in advance.


Reply With Quote
