s2cmd
내 유닉스 컴퓨터에 패키지를 설치했습니다 . 폴더가 있는 폴더에서 실행하면 제대로 작동하지만 다른 위치에서는 실행되지 않았기 때문에 이 폴더 안에 실행해야 할 export PATH=$PATH:/opt/bitnami/S3Tools/s3cmd-1.5.0-alpha1
파일이 있다는 명령을 사용하여 PATH를 설정했습니다.s3cmd
이제 문제는 을 수행할 때 which s3cmd
올바른 경로를 출력으로 얻었지만 을 사용하여 실행하면 이라고 표시된다는 것 sudo s3cmd
입니다 command not found
. 절대 경로를 지정하고 실행하려고 하면 모든 위치에서 실행됩니다.
내가 도대체 뭘 잘못하고있는 겁니까?
편집하다 :방금 동일한 경로를 가진 2개의 PATH 변수가 있다는 것을 확인했습니다. 그게 문제의 원인인가요? 그렇다면 어떻게 수정합니까?
$ set | grep PATH
PATH=/opt/bitnami/rvm/bin:/opt/bitnami/memcached/bin:/opt/bitnami/varnish/bin:/opt/bitnami/redis/bin:/opt/bitnami/nodejs/bin:/opt/bitnami/mercurial/bin:/opt/bitnami/perl/bin:/opt/bitnami/git/bin:/opt/bitnami/nginx/sbin:/opt/bitnami/frameworks/laravel/app/Console:/opt/bitnami/frameworks/cakephp/app/Console:/opt/bitnami/frameworks/codeigniter/bin:/opt/bitnami/frameworks/symfony/bin:/opt/bitnami/frameworks/zendframework/app/Console:/opt/bitnami/sphinx/bin:/opt/bitnami/sqlite/bin:/opt/bitnami/apps/django/bin:/opt/bitnami/php/bin::/opt/bitnami/java/bin:/opt/bitnami/mysql/bin:/opt/bitnami/postgresql/bin:/opt/bitnami/apache2/bin:/opt/bitnami/python/bin:/opt/bitnami/subversion/bin:/opt/bitnami/ruby/bin:/opt/bitnami/common/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/bitnami/S3Tools/s3cmd-1.5.0-alpha1:/opt/bitnami/S3Tools/s3cmd-1.5.0-alpha1
_=PATH
export PATH;
PATH="$2:$PATH"
PATH="$PATH:$2"
PATH="${rvm_user_path_prefix}:$PATH";
PATH="$(printf "%b" "$PATH" | awk -v RS=: -v ORS=: '!($0 in a){a[$0];print}')";
PATH="${PATH/%:/}";
export PATH;
if printf "%b" "${PATH//:/ }" | GREP_OPTIONS="" \grep -vF "${rvm_bin_path}" > /dev/null 2>&1; then
PATH="$PATH:${rvm_bin_path}"
PATH="${rvm_bin_path}:$PATH"
printf "%b" "export PATH ; PATH=\"${rvm_ruby_gem_home}/bin:${rvm_ruby_global_gems_path}/bin:${rvm_ruby_home}/bin:${rvm_bin_path}:\$PATH\"\n" > "$file_name";
for variable in rvm_env_string rvm_path rvm_ruby_string rvm_gemset_name RUBY_VERSION GEM_HOME GEM_PATH MY_RUBY_HOME IRBRC MAGLEV_HOME RBXOPT;
export PATH;
\awk '/PATH/' < "$actual_file";
rvm_error "Neither md5 nor md5sum were found in the PATH";
rvm_error "Neither md5 nor md5sum were found in the PATH";
export PATH;
PATH=":$PATH:";
PATH="${PATH//:$1:/:}";
PATH="${PATH//::/:}";
PATH="${PATH%:}";
PATH="${PATH#:}"
PATH="$(printf "%b" "$PATH" | awk -v RS=: -v ORS=: "/${rvm_path//\//\/}/ {next} {print}")";
PATH="${PATH/%:/}";
export PATH;
export GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION IRBRC;
rvm_error "Neither sha256sum nor shasum found in the PATH";
rvm_error "Neither sha256sum nor shasum found in the PATH";
export GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION IRBRC;
GEM_PATH="$rvm_ruby_gem_path";
unset BUNDLE_PATH;
GEM_PATH="$GEM_PATH:$MAGLEV_HOME/lib/maglev/gems/1.8/";
new_path="$GEM_HOME/bin:$rvm_ruby_global_gems_path/bin:$MY_RUBY_HOME/bin:${rvm_bin_path}:$(__rvm_remove_rvm_from_path ;printf "%b" "$PATH")";
new_path="$GEM_HOME/bin:$MY_RUBY_HOME/bin:${rvm_bin_path}:$(__rvm_remove_rvm_from_path ;printf "%b" "$PATH")";
export PATH="$new_path";
unset GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION IRBRC;
new_path="$(__rvm_remove_rvm_from_path ; printf "%b" "$PATH"):${rvm_bin_path}";
new_path="$PATH:${rvm_bin_path}";
COMPREPLY=($( eval PATH="$PATH:/sbin" $cmd 2>/dev/null | awk '/^[^ \t]/ { print $1 }' ));
if [[ -z "${CDPATH:-}" || "$cur" == ?(.)?(.)/* ]]; then
for i in ${CDPATH//:/'
if [ "${INFOPATH: -1:1}" == ':' ]; then
infopath=${INFOPATH}${infopath};
if [ ${INFOPATH:+set} ]; then
infopath=$INFOPATH;
COMPREPLY=($( compgen -W "$( PATH="$PATH:/sbin" lsmod | awk '{if (NR != 1) print $1}' )" -- "$1" ))
[ -z "$classpath" ] && classpath=$CLASSPATH;
local PATH="$PATH:/sbin:/usr/sbin";
manpath=$MANPATH;
COMPREPLY=(${COMPREPLY[@]:-} $( compgen -W "$( PATH="$PATH:/sbin" lspci -n | awk '{print $3}')" -- "$cur" ))
local PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin;
COMPREPLY=("${COMPREPLY[@]}" $( compgen -W "$( PATH="$PATH:/sbin" ifconfig -a | sed -ne 's/.*addr:\([^[:space:]]*\).*/\1/p' -ne 's/.*inet[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p' )" -- "$cur" ))
COMPREPLY=($( compgen -W "$( PATH="$PATH:/sbin" sysctl -N -a 2>/dev/null )" -- "$cur" ));
COMPREPLY=(${COMPREPLY[@]:-} $( compgen -W "$( PATH="$PATH:/sbin" lsusb | awk '{print $6}' )" -- "$cur" ))
GEM_PATH="$rvm_ruby_gem_home:$rvm_ruby_gem_home${rvm_gemset_separator:-"@"}global";
export rvm_ruby_gem_home GEM_HOME GEM_PATH;