I'm operating Ubuntu 20.04 on WSL2, and a little new to the bash syntax.
I overwrote the LD_LIBRARY_PATH when following a set of CUDA installation instructions, which specified to update as follows:
$ export LD_LIBRARY_PATH=/usr/local/cuda-11.5/lib64\
${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
The value LD_LIBRARY_PATH now only contains the specified path /usr/local/cuda-11.5/lib64\ and no other paths, so I'm wondering if I accidentally overwrote the old path (because of the carriage return in the middle?) instead of appending to it.
There are two possibilities:
- The path was empty to start with, so nothing was overwritten, and no action required. This answer seems to indicate that it's originally empty, but running
strings /etc/ld.so.cache
as one of the comments suggest returns a long list. - The path wasn't empty, in which case I'd like to restore it.
export
on bash only affects that bash session. So, if you start a new bash session, the variable will be set to the original value that it had. Only that specific bash where you ran theexport
is affected. – eftshift0 Nov 06 '21 at 03:21LD_LIBRARY_PATH
must be directly adjacent, with no spaces or line breaks in between. In shell syntax, things like spaces are important delimiters, and adding or removing them can change the meaning of a command completely. – Gordon Davisson Nov 06 '21 at 04:39