help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to get a directory's "full" name?


From: Paul D. Smith
Subject: Re: how to get a directory's "full" name?
Date: Fri, 12 May 2006 13:18:31 -0400

%% "Aditya Kher" <address@hidden> writes:

  >> cd to arg, then echo full dir name.  is there a simpler or built-in
  >> way that's better?

  ak> the unix command dirname gives the directory name
  ak> see also basename for getting file name in a similar manner

dirname and basename are simply string munchers: they break up strings
on "/" etc.  They do NOT evaluate their arguments to find
fully-qualified pathnames.

In addition, the make functions $(dir ...), $(notdir ...), $(basename ...),
etc. are much better/faster for this kind of thing, as long as you don't
need to work on a shell variable.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

[Prev in Thread] Current Thread [Next in Thread]