Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a bash scripts that contains the following lines:

MY_HOME="@INSTALLED_AT@"
LD_LIBRARY_PATH="@INSTALLED_AT@/lib"
MY_BIN="@INSTALLED_AT@/bin"

export  MY_HOME
export  LD_LIBRARY_PATH

exec "$MY_BIN/my.bin" ${1+"$@"}

I am particulary confused by @INSTALLED_AT@. Specifically, what does

MY_HOME="@INSTALLED_AT@"

do?

share|improve this question
    
Where did you get the script from, what does it do? –  Donarsson Feb 27 at 17:14
1  
I am trying to understand software which I haven't written myself. One of the bash scripts contains the code you see above. I don't know what the script is supposed to do, hence I asked this question. –  mcwise Feb 27 at 17:18

1 Answer 1

up vote 7 down vote accepted

This is probably a stub file. The syntax @INSTALLED_AT@ means nothing to bash; it's just a string as another one.

In the package/source/Makefile there is probably another script (maybe a simple sed) which will edit this stub and substitute the @INSTALLED_AT@ with the actual installation path, which can be different or user-selectable.

See:

(0)asus-romano:~% var="@INSTALLED_AT@/bin"
(0)asus-romano:~% echo $var
@INSTALLED_AT@/bin
(0)asus-romano:~% echo $var | sed s+@INSTALLED_AT@+/usr/local+g 
/usr/local/bin
share|improve this answer
    
I have suspected as much. That clears things up for me. Thanks! –  mcwise Feb 28 at 12:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.