简体   繁体   English

在Linux中安装脚本是什么意思

[英]What does it mean in Linux for installing script

I am trying to install some scripts into linux and follwoing line is given as instruction. 我正在尝试将一些脚本安装到linux中,以下行作为说明。

  1. Install the xyz script into some convenient directory in $PATH. 将xyz脚本安装到$ PATH中的某个方便目录中。

but I'm unable to understand what exactly does it mean.How do I install given script in $PATH directory.Script is placed under /users/username/ Dir. 但是我不明白它到底是什么意思。如何在$ PATH目录中安装给定脚本。脚本位于/ users / username / Dir下。

In a terminal type echo $PATH . 在终端中,键入echo $PATH You will see a list of directories. 您将看到目录列表。 Put your script, or a link to your script in one of those directories, typically in /usr/local/bin . 将您的脚本或脚本的链接放在这些目录之一中,通常在/usr/local/bin

its a bad description of the script-author :) usually, in your $PATH are multiple directories mentioned, separated by colon. 它对脚本作者的错误描述:)通常,您的$ PATH中提到的多个目录以冒号分隔。

you can echo them: 您可以回显它们:

echo $PATH 回声$ PATH

What the Author means: just copy the script in a directory which is in your $PATH, eg /usr/local/bin 作者的意思:只需将脚本复制到$ PATH中的目录中,例如/ usr / local / bin

$PATH is a list of directories where bash looks for executables. $ PATH是bash在其中查找可执行文件的目录的列表。

The given instruction suggests that yours scripts should be put in one of these directories. 给定的说明建议您将脚本放在这些目录之一中。

An alternative is to put your scripts in any directory and add that directory to $PATH. 一种替代方法是将脚本放置在任何目录中,然后将该目录添加到$ PATH中。 In your case, add the following line in your $HOME/.bash_profile configuration file: 根据您的情况,在$ HOME / .bash_profile配置文件中添加以下行:

export PATH=$PATH:/users/username

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM