I am following a procedure that indicates creating a symbolic link:

sudo ln -s $(DynamsoftBarcodeReader)/lib/libDynamsoftBarcodeReader.so /usr/lib/libDynamsoftBarcodeReader.so

I am interpreting this to mean that I need to implement:

sudo ln -s /home/pi/Desktop/dbr/lib/libDynamsoftBarcodeReader.so /usr/lib/libDynamsoftBarcodeReader.so

My question / concern is the $ in the procedure: what is its purpose? Attempts to Google were not successful

enter image description here

  • Why a screenshot instead of copying the output? – phk Oct 26 '16 at 11:59

Assuming that you're meant to type this in a shell, this is a command substitution. The shell executes the command DynamsoftBarcodeReader and replaces $(DynamsoftBarcodeReader) in that command line by the output obtained by running DynamsoftBarcodeReader. For example, if the command DynamsoftBarcodeReader prints /home/pi/Desktop/dbr, then the target of the symlink will be /home/pi/Desktop/dbr/lib/libDynamsoftBarcodeReader.so.

Note to future visitors: in a makefile, the syntax $(…) has a different meaning: it takes the value of a variable. This tutorial doesn't mention makefiles anywhere, so presumably the command is intended to be typed on the command line, in a shell such as bash, and there it's a command substitution.

If the $ was actually in a symbolic link, it would have no special meaning, the symlink would just be pointing to a target that happens to contain the character $. But that's not happening here.

  • Given the context and the posted screenshot, have I correctly created the symbolic link? Thanks for introducing command substitution – gatorback Oct 25 '16 at 23:41
  • @gatorback I don't know. You have created a symlink, and it makes sense, but I don't know that software, so I can't be sure that it's the right link. – Gilles 'SO- stop being evil' Oct 25 '16 at 23:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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