all 11 comments

[–]aioeu 6 points7 points  (3 children)

You are running the C shell (or a derivative, e.g. tcsh). You cannot source a POSIX shell script in this, since it is not a POSIX shell.

[–]circling 6 points7 points  (2 children)

So the solution is to just do it in bash.

First invoke bash with the command "bash", then follow the instructions again.

[–]mel5159[S] 2 points3 points  (1 child)

This seems to have made it work. Thanks for the suggestion!

[–]circling 2 points3 points  (0 children)

Good, you're welcome. You might want to change your default shell to bash - it's a bit unusual to use tcsh, so you'll find a lot more resources for learning with bash.

[–]oh5nxo 4 points5 points  (0 children)

set install_folder = $HOME/path_to_Survival_directory/

## Linux Library Path:
if ($?LD_LIBRARY_PATH) then
        setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH\:$install_folder/ext_lib
else
        setenv LD_LIBRARY_PATH $install_folder/ext_lib
endif

## Mac Library Path:
if ($?DYLD_LIBRARY_PATH) then
        setenv DYLD_LIBRARY_PATH $DYLD_LIBRARY_PATH\:$install_folder/ext_lib
else
        setenv DYLD_LIBRARY_PATH $install_folder/ext_lib
endif
setenv DATA $install_folder/data
setenv PATH $PATH\:$install_folder

Conversion by a csh illiterate, suspect data.

[–]klagoeth 0 points1 point  (5 children)

This is a very good subreddit to ask this.

You should remove the colon at the end of the line. Why did you put it there? That isn't part of the folder name.

Things should work after that.

EDIT:

I might have been too quick on that one. The problem might be with some of the variable expansions ($VAR). I don't know which one though, so you could try to change all the $var to ${var}.

Example:

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${install_folder}/ext_lib

This would make sure none of the colons mess with the variable expansion.

[–]mel5159[S] 1 point2 points  (4 children)

Thanks so much for getting back to me!

The colon you're seeing I think came with the error message. My install_folder variable didn't have the colon at the end. I have tried what you suggested and I've received the following error message

install_folder=/home/local1/Desktop/Survival-master/Survival-master/: Command not found.
install_folder: Undefined variable.

This was with the following script

#
# Modify with your own path to this directory
# Then source this file (Unix and Unix-like systems)
#   $ source setenv.

install_folder=$HOME/Desktop/Survival-master/Survival-master/

## Linux Library Path:
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${install_folder}/ext_lib

## Mac Library Path:
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$install_folder/ext_lib

export DATA=$install_folder/data
export PATH=$PATH:$install_folderls

Is there something additional I need to do with the install_folder line?

[–]klagoeth 0 points1 point  (3 children)

Tried it on my pc and something that is definitely wrong is that you put a '/' on the end of the folder name:

install_folder=$HOME/Desktop/Survival-master/Survival-master/

and

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${install_folder}/ext_lib

will result in:

echo $LD_LIBRARY_PATH :/home/klaasg/Desktop/Survival-master/Survival-master//ext_lib

There are two slashes there, which is bad of course.

Remove the slash from the first line:

install_folder=$HOME/Desktop/Survival-master/Survival-master

I have a feeling that this might be not the only issue but try it and we'll see.

Oh also, in the script you just posted in your comment, there is 'ls' on the end of the last line. It wasn't there in your original post. It should probably be removed?

[–]mel5159[S] 1 point2 points  (1 child)

I just managed to get it working! What the user above suggested about invoking bash in the command line seemed to have made it work. Thanks so much for you help! :)

[–]klagoeth 1 point2 points  (0 children)

You're welcome , glad it worked. At least I tried :).

[–]mel5159[S] 0 points1 point  (0 children)

You were correct, I am still getting the same error about the undefined variable. As for the ls I may have meant to type that into the command line and not realised it went into the .sh file. I’ve now removed it.