Programming :: Exporting Makefile Variables To $(shell) Environment?

May 12, 2010

I'm aware that one can export make variables to other makefiles; however, how does one export them to the environment of $(shell)? Take the example below:

Code:
export TEST
VARIABLE=$(shell echo $$TEST)
.PHONY: all
all:
#$(VARIABLE)

In this example, I might call make TEST=test. The goal is for $TEST to be available to the environment of the shell escape. This is because I need its value in a script which is called. For example:

Code:
VARIABLE=$(shell i-need-TEST.sh)My current solution is the following:VARIABLE=$(shell export TEST="$(TEST)"; i-need-TEST.sh) but this only works if I know all if the variables needed at that point (as opposed to being able to export variables in included makefiles.) Is there an easy solution?

View 4 Replies


ADVERTISEMENT

General :: Exporting Environment Variables In Ubuntu?

Jun 2, 2010

I know many people have asked about environment variables before, but I am having a hard time dealing with these paths while ensuring I don't mess around with the original settings. How would you go about executing these commands in Ubuntu in terms of environment variables?

put /home/stanley/Downloads/ns-allinone-2.34/bin:/home/stanley/Downloads ns-allinone-2.34/tcl8.4.18/unix:/home/stanley/Downloads/ns-allinone-2.34/tk8.4.18/unixinto your PATH environment; so that you'll be able to run itm/tclsh wish/xgraph.

IMPORTANT NOTICES:

(1) You MUST put
/home/stanley/Downloads/ns-allinone-2.34/otcl-1.13,
/home/stanley/Downloads/ns-allinone-2.34/lib,
into your LD_LIBRARY_PATH environment variable.

[Code]....

View 1 Replies View Related

Programming :: Script Not Exporting Variables?

Jun 7, 2011

I have sles 10 . A user has a default shell of tcsh. I want to run a script which has to use ksh . In that script only some variables are exported, which will be used in subsequent scripts which are called inside it.

But the variables are not exported. I am unable to find whether its a conflict of shell or what ?? I tried with debug mode, it only displays the command but not execute anyone ..

View 14 Replies View Related

General :: Set Environment Variables For A Particular User On C Shell Configurations?

Jun 2, 2011

I have been give a task of replicating one of our production systems to create a test system. I have been restricted to use c shell to set up its environment variables. I am new to this my questions is how do i set environment variables for a particular user on c shell e.g ORACLE_HOME and ORACLE_SID permanently for a particualar user i know in bash you edit the .bash_profile file. What do i do for c shell?

View 2 Replies View Related

Ubuntu :: Write A Simple Shell Script And Environment Variables?

Feb 8, 2010

I'm trying to write a simple shell script, its purpose is not important. The script needs to make use of the system $HOSTNAME environment variable. I had a look at this page which provides the following example.

Code:
#!/bin/sh
echo "You are user $UID on $HOSTNAME"
echo "Your home directory is: $HOME"
echo "$HOSTNAME is running $OSTYPE"

[Code]...

View 6 Replies View Related

Programming :: Exporting In A Shell Script?

Nov 26, 2010

I am aware this has probably been covered hundreds of times, so apologies if so. I am fairly new to the linux scripting scene, so again apologies if what I'm saying seems pretty odd and makes no sense. I am attempting to write a script for some Linux Fedora test servers I have set up. For me to change which domain I have this set to point to, I would have previously changed the HOSTS and profile files manually, however I managed to make a script which changes these easily with the use of one command to launch the script.The problem I'm having is getting it to use the "export" command. I am aware this would have to be launched in the parent shell rather than the child and so I made a seperate script which has "export SIP_DOMAIN="test.blah.net" in it and had the first script "source" it. This doesn't work and I've probably done something somewhere that is incredibly stupid.

View 2 Replies View Related

Programming :: Makefile - No CXX Environment Variable

Jan 6, 2010

When I put a "test" target in my Makefile containing
Code:
@echo "CXX= $(CXX)"
it tells me "CXX= g++".
But I have nothing in the Makefile assigning any value to CXX, and as far as I can tell I have no CXX environment variable (no "CXX" appears when I run the shell command "env", and "echo $CXX" returns a blank line. So where's the g++ value coming from. Is this just built into Gnu Make, or is there a configuration file for make somewhere?

View 2 Replies View Related

Programming :: Using Environment Variables In Scripts?

Jun 19, 2010

Trying to mounts three cifs shares at boot up. I want to mount the shares under three different sub directories in the user's home directory:

share 1 mounted to /home/(insert username here)/movies
share 2 mounted to /home/(insert username here)/music
share 3 mounted to home/(insert username here)/software

I would like to use the environment variable HOME to dynamically build the mount point parameter. I've tried:

View 14 Replies View Related

Programming :: Use Environment Variables That Are Defined Outside Of The Script?

Feb 8, 2011

I am writing an expect script and I wish to use environment variables that are defined outside of the script.

View 6 Replies View Related

Programming :: Sudo Perl Script With Environment Variables?

Apr 22, 2009

How to use sudo to run a perl script with the environment variable JAVA_HOME on linux?
Running testenv.pl as sudo do not pickup the environment variable JAVA_HOME
value. code...

View 1 Replies View Related

Programming :: MHC Modula-2 - Cannot Access The Command Line Options And The Environment Variables

Jul 2, 2010

Anyone else using the Mill Hill & Canterbury (MHC) Modula-2 to Java compiler?

[URL]

I cannot access the command line options and the environment variables.

View 2 Replies View Related

Programming :: Setting Variables In C-shell?

Jul 12, 2010

I'm running into a problem when I try to set a variable to an awk output in c-shell. Right now my command is Code: set STR_MSG_TYPE = `awk -F{ '/msg_type/ {print $2}' <filename> | tr -d }'/''*' ` I then run echo to see what the output is and it returns blank, however, when I run the same awk command from the command line, I get an actual output of "MT-715". Am I setting my variable incorrectly? I do something similar using the date command to set a STR_DATE variable earlier in the code and it works fine and I use the same syntax.

View 1 Replies View Related

Programming :: Shell - Substition Of Variables?

Mar 22, 2011

i have following code :

Code:
TMPDIR=`mktemp -d`
mkdir $TMPDIR/old/

[code]...

View 3 Replies View Related

Programming :: Advanced Uses Of Variables In Korn Shell?

Jul 28, 2011

Somehow I'm not really managing this thing, which would d be a nice way to useariables.What I am doing is setting up compound variable in ksh. What I have is a "config" file, which has fields delimited by a semicolon

Code:
cat ${CONFIGFILE} | grep -v "^#" | grep -v "^$" | while read line
do

[code]...

View 14 Replies View Related

Programming :: Indexing Variables In Lists Using Shell Scripts?

May 27, 2010

I have a question concerning indexing over lists with unix shell scripts. I have very large text files (up to 20 Gb) with the data shown below:

80011412865610
43000216943210
4710510513101

[code]...

View 14 Replies View Related

Programming :: C-shell Scripting Syntax Error When Defining Two Variables A1 And A2

Apr 5, 2011

I am trying to modify a script for research purposes and am having difficulty here as I have little prior experience with C-shell scripting.

The script looks as follows (it includes tcl commands like runFEP that you can ignore)

#!/bin/bash

for ((old=1, new=2; old<=4; old++,new++))
a1=${old}%50
a2=${new}%50
do
cat > input${new}.conf <<EOF
${a1}
code....

My question: I keep getting a syntax error when defining my two variables a1 and a2. I essentially need these variables to be
a1 = value of variable old divided by 50
a2 = value of variable new divided by 50

View 1 Replies View Related

Software :: [makefile] Complementing Env't Variables?

Jan 19, 2011

I'd like to write a top-level Makefile, and define environment variables further in deeper Makefiles:

/tmp# cat main.mk
Code:
export TEST=dummy
/tmp# cat sub.mk
Code:
include main.mk

[Code]...

1. How to complement an environment variable to add data as we chain multiple Makefiles?
2. How to actually export variables from Makefiles so that they are available in other Makefiles?

View 4 Replies View Related

Programming :: Shell Script - Entering The Chroot Environment ?

Jul 19, 2010

My script is like this

Code:

How can i make the script do all those command using the script?

View 1 Replies View Related

Programming :: Makefile - Error When Run The Make Run - No Rule To Make Target - Shell.h

Sep 15, 2010

I want to gave much details as possible. working directory (~/a1/shell) in the shell directory i have Makefile. also in the shell directory i have subdirectory's (obj, src, include)

My current Makefile

Quote:

#What needs to be built to make all files and dependencies

clean:

# End of Makefile

I wanted it so: all .o files are created in the obj subdirectory, and my application, sshell, is created in the shell directory.

I am getting this error when i run the make run: No rule to make target 'shell.h', needed by 'shutil.o'. stop

View 1 Replies View Related

Fedora :: How To Set Environment Variables

May 18, 2010

I just installed valgrind on my Fedora12 machine.

$ valgrind // 1
$ valgrind: Command not found. //error
$ /usr/local/bin/valgrind // 2 works fine

[code]...

View 3 Replies View Related

Debian :: Python 2.7 Can't See OS Environment Variables

Aug 23, 2015

I'm trying to compile Ardour on jessie amd64 using the Debian source code (there's already an ardour package but I want to use different compile options). I've applied the Debian patches and have all the required dependencies installed.

Scons quits with a KeyError message from python2.7 saying that os.environ['DEB_HOST_ARCH_OS'] is not defined.

Checking with 'dpkg-archtecture -l' shows that DEB_HOST_ARCH_OS=linux, but 'print os.environ["DEB_HOST_ARCH_OS"]' in python says that name 'os' is not defined. The scons script has 'import os' at the top so it should be seeing it.

How do I make this visible to python (I'm assuming this problem is specific to the jessie python2.7 installation and not python in general)?

View 1 Replies View Related

Fedora :: Changing Environment Variables?

Oct 11, 2009

How do I edit my .bash_profile so recursive directories are on my path without manually typing all the directories? For example, I want to have /home/woodenbox/SU, /home/woodenbox/SU/bin, /home/woodenbox/SU/bin/src, etc on my path without actually having to write the paths for all the subdirectories

View 3 Replies View Related

Fedora :: How To Set Environment Variables Permenently

May 3, 2011

How to set JAVA_HOME environment variables permanently such that it will not have to be set each time it has to be used.

View 5 Replies View Related

General :: Any Other Ways To Set Environment Variables

May 20, 2010

I am running Red Hat Linux Enterprise 5; I am always using the export command to set environment variables.Are there any other ways to set environment variables and what are the advantages/disadvantages of them?

View 4 Replies View Related

General :: Environment Variables Not Being Set Correctly?

Jun 21, 2010

he $g09root is picked up ( in both the csh and the bash), but not the $GV_DIR or the $GAUSS_SCRDIR. I guess it's some stupid error, but it is highly frustrating.Here is the .profile file:Quote:

# To make use of this feature, simply uncomment one of the lines below or
# add your own one (see /usr/share/locale/locale.alias for more codes)
#

[code]...

View 9 Replies View Related

Software :: Environment Variables And Konsole In KDE?

Apr 27, 2011

I have installed jdk in my pc, and i've set up the environment variable on the .bashrc file in my home directory although i can use java's compiler and interpreter in terminal (xfce) if i try to use these commands in konsole (kde) for some reason they don't work. do i need to edit other file?

Nevermind, i found out that konsole was being executed with -e $SHELL -l parameters, once i took them out, and just ran konsole everything worked.

View 6 Replies View Related

Software :: Set Environment Variables That Don't Need Terminal ?

Jun 12, 2011

I've added an export command to /etc/profile, but the environment variables don't show up when not using a terminal.

For example: when I add:

Code:

To my /etc/profile (then open a new terminal so it registers) and run a graphical program from that terminal, the graphical program can see see the environment variable A.

However if I add the export command to my /etc/profile, then reboot so everything registers, then run that same graphical program from a menu (such as Applications->Accessories->Myprogram), it can't see the environment variable.

What I'm trying to say is basically, my environment variables only show up if I run a program in a shell. Is there a way to set environment variables that will show even without a shell?

View 2 Replies View Related

Debian :: Unable To Change Environment Variables

Dec 17, 2015

I installed debian 8 on a usb drive using this guide. I used a debian 8.2 64-bit image with mate. It has all worked as I wanted it to. However recently I needed to change the PATH variable, and create another environment variable. I have not been able to do neither. What I have tryed (from google):

1. adding "export PATH=$PATH:/xxxx/" to etc/profile or to /home/user/.profile
2. adding ":/xxxx/" to a point in /etc/profile where the PATH variable is set
3. creating a script in /etc/profile.d which run "export PATH=$PATH:/xxxx/"

(where xxxx is the the location i want to add)

View 7 Replies View Related

Debian Configuration :: Environment Variables For All Users

Nov 27, 2015

I'm newbie on Debian, and I just installed Debian 8.2. (I used to run openSuse, and I see Debian is quite different.)

Where should I set environment variables (like PATH or JAVA_HOME) in order to affect all users?

I read some documentation about that, but It is not clear for me, the difference among "/etc/environment", "/etc/bash.bashrc" and "/etc/profile".

(In openSuse, I used to create a file "/etc/bash.bashrc.local" and set the environment variables there, in order these settings are not lost with updates.)

View 1 Replies View Related

Fedora :: Script Unable To Set Environment Variables

Nov 24, 2010

I've never done much scripting myself and I'm quite unused to the bash as well, but anyway, Here's my problem.

I've a script which is supposed to set some environment variables, using export. However, if I check those variables using echo, they appear not to be set (they are empty). If I set the same variables manually, everything is fine, of course, but I don't want to set them each time manually.

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved