On Tue, Sep 25, 2001 at 08:24:12PM +0200, Raffaele Sandrini wrote: | Hi, | | I have a problem with bash vars. For my KDE copileing stuff i have made some | files wich contain the "configure" command so that i can easily alter it and | that i can remember wich options i used. E.g. there is a file "conf_kdelibs" | the file contais that line: | ./confugure --prefix=/opt/kde --enable-final ....... | Now i want to set for the prefix /opt/kde the $KDEDIR variable. | This "conf_kdelibs" file is called by my compile script with the command " | 'cat conf_kdelibs' ". Now bash is not taking the $KDEDIR varibale contents it | takes the string "$KDEDIR". How can i bring BASH to take KDEDIR as a variable?
First : any time you are writing code and it doesn't work, you need to post the code that doesn't work _exactly_ for anyone to do more than take wild gueses as to the problem. Here is a correct way to write your script : --------------- cut here ------------------- #!/bin/bash export KDEDIR=/whatever/the/path/is ./confugure --prefix=/opt/kde --enable-final ....... --------------- cut here ------------------- To run it, first make it executable (chmod u+x) then go the the base directory of the source. For example : (not real cut-n-paste output) $ pwd ~/build $ ls conf_kdelibs kdelibs-src $ cd kdelibs-src $ ../conf_kdelibs $ If you unpack the source into a versioned directory, the script won't care. It looks for configure in the current working directory so you must be in the app's directory not the directory with the script. HTH, -D