help-make
[Top][All Lists]
Advanced

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

Re: shell functions from env not available in make?


From: gk
Subject: Re: shell functions from env not available in make?
Date: Thu, 24 Oct 2002 23:55:31 -0700

At 12:39 AM 10/25/2002 -0400, Paul D. Smith wrote:
%% gk <address@hidden> writes:

  g> I have sourced a function 'xmsubdirs' into my current shell and was
  g> expecting it to be available from a makefile rule but it is not.

This is a shell question, not a GNU make question.  If you do this:

  $ echo 'all:;@env' | make -f-

you'll see that make _does_ export the function variable to the
processes it invokes, just as it would any other environment variable.

I am not seeing any function variables output from that or from env command in the shell.
the 'set' command outputs the functions.



If they don't show up in the subshell it means that the shell is not
processing them.  Perhaps bash ignores functions unless it's invoked as
an interactive shell.

My shell is interactive.
Running my function in a subshell from the terminal works fine:
address@hidden project]$ (xmsubdirs)
subdir1 subdir2



You'll have to ask on the bash help/bug lists.


There is no bash help list that I could find.
The bash homepage on savannah lists no mailing lists.
Sorry to bother you if it has nothing to do with bash. I'll try comp.unix.shell.
- Greg Keraunen





reply via email to

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