LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-10-2014, 08:46 AM   #1
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
bjam boost_build PWD question


I hope there are some experts in bjam here.

I want a way to get pwd inside boost without following sym links.

In bash, I can use $(pwd) and get the current directory. That does what I want (doesn't follow sym links).

In the bjam language, you get current directory with [ PWD ] but that follows sym links and gives you the destination of the sym link, which is not what I want.

example:
cd /foo/bar
where /foo/bar is a sym link to /elsewhere
bash $(pwd) gives you /foo/bar
bjam [ PWD ] gives you /elsewhere

 
Old 10-10-2014, 09:00 AM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Original Poster
Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Never mind.

Quote:
Originally Posted by johnsfine View Post
I want a way to get pwd inside boost without following sym links.
I don't know why the obvious answer was so non obvious until I posted the question, but suddenly became obvious just because I posted.

In the situations where the difference (sym link or not) matters to me, there is also an environment variable PWD.

In bjam
PWD ?= [ PWD ] ;
defines a bjam variable as the environment variable if it was defined and the result of the PWD function only if the environment variable wasn't defined. Then I use
$(PWD) instead of [ PWD ] where I actually need it.

Sorry I bothered you.

Last edited by johnsfine; 10-10-2014 at 09:03 AM.
 
Old 10-10-2014, 04:33 PM   #3
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Original Poster
Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Back to the original question.

This build code is run in many environments, including Linux where the $PWD environment variable is correct and various Windows situations where $PWD is either correct or missing. But there is also a Windows environment where the $PWD environment variable is present but wrong.

That is hard for me to test for and this is getting messy. So I'm back to the original question of how to get the current directory in bjam language, but without following sym links.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Boost (bjam) vs automake stoyboy Linux - Software 2 09-21-2010 05:46 AM
'pwd' question Captain Morgan Linux - Newbie 4 08-19-2009 05:21 AM
question about putting pwd in $PATH nadroj Linux - Newbie 5 05-30-2005 05:34 PM
reset pwd to root's current pwd? ataraktos2 Linux - General 10 04-26-2005 05:13 AM
PWD question : Current dir not full path facets Programming 2 06-09-2004 05:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration