程序安装:Csh to Bash

Neu*_*uls 1 bash environment-variables csh

我正在尝试安装 xscore v1.3 ( XSCORE MANUAL )。它们提供了在 C-shell 下的 .cshrc 文件中设置一些环境变量的说明。

    setenv XTOOL_HOME   the_installation_directory_of_X-Score
    setenv XTOOL_PARAMETER  $XTOOL_HOME/parameter
    setenv XTOOL_BIN  $XTOOL_HOME/bin
    set path = ($path  $XTOOL_BIN)

If you are using other types of shell, please add the equivalent contents to your configuration file.
Run Code Online (Sandbox Code Playgroud)

由于我使用的是 Bash,我尝试使用他们推荐的等效命令修改 .profile 文件:

# set PATH so it includes user's private bin directories
XTOOL_HOME=/home/marta/Peptide/oficial-MC/sf/xscore_v1.3
XTOOL_PARAMETER=$XTOOL_HOME/parameter
XTOOL_BIN=$XTOOL_HOME/bin

PATH="$HOME/bin:$HOME/.local/bin:$PATH:$HOME/Programs/VMD/:$PATH:$XTOOL_HOME:$PATH:$XTOOL_PARAMETER:$PATH:$XTOOL_BIN"
Run Code Online (Sandbox Code Playgroud)

但是,运行程序时出现以下错误:

marta@dagon:~$ xscore -fixpdb HER21.pdb try.pdb

X-Score starts to run ... Wed Sep 26 09:26:29 2018

Warning: XSCORE_PARAMETER is not set ... use default setting

Error: cannot open the file ../parameter/RESIDUE_DEF_XTOOL Please make sure it exists.
Run Code Online (Sandbox Code Playgroud)

该文件夹与文件一样存在,但程序似乎无法找到它们。我想知道环境变量的设置是否有问题。

Kus*_*nda 6

要设置环境变量,您必须同时为 shell 变量和export它分配一个值。这可以一次性完成

export variable=value
Run Code Online (Sandbox Code Playgroud)

或分两步

variable=value
export variable
Run Code Online (Sandbox Code Playgroud)

在你的情况下:

XTOOL_HOME=/home/marta/Peptide/oficial-MC/sf/xscore_v1.3
XTOOL_PARAMETER="$XTOOL_HOME/parameter"
XTOOL_BIN="$XTOOL_HOME/bin"

export XTOOL_HOME XTOOL_PARAMETER XTOOL_BIN

PATH="$PATH:$XTOOL_BIN"
Run Code Online (Sandbox Code Playgroud)

注意 的设置PATH。您的代码不必要地包含PATH 四次的旧值。以上复制了建议的csh代码。

此外,错误消息提到XSCORE_PARAMETER但我不确定这是什么。它要么是由您的程序根据上述一个或多个环境变量(自动)设置的,要么是您应该手动设置为手册中未提及的内容。

根据评论,这实际上可能是手册中的错字,并且各种XTOOL变量实际上应该以字符串XSCORE而不是XTOOL.