쉘 스크립트 파일을 실행할 수 없습니다. 권한이 거부되었습니다.

쉘 스크립트 파일을 실행할 수 없습니다. 권한이 거부되었습니다.

기본적으로 자일링스 도구를 설치하기 위한 설정 파일인 쉘 스크립트 파일이 있습니다. 파일 이름은 xsetup입니다.

여기에 이미지 설명을 입력하세요

또한 이 작업을 수행한 후 권한을 확인했습니다.

chmod  777 xsetup

여기에 이미지 설명을 입력하세요

실제로 전체 폴더(내 xsetup이 있는)의 권한은 다음과 같습니다. (모든 폴더에 대해 읽기 및 쓰기를 수행한 파일 액세스, 이 스크린샷에는 표시되지 않음) 여기에 이미지 설명을 입력하세요

그러나 파일을 실행하려고 하면 오류가 발생합니다.

[root@sulaptop xilinx]# sh xsetup
xsetup: line 30: ./bin/lin/xsetup: Permission denied
[root@sulaptop xilinx]# bash xsetup 
xsetup: line 30: ./bin/lin/xsetup: Permission denied
[root@sulaptop xilinx]# 

이미 루트로 로그인했는데 왜 이 권한 오류가 발생합니까? 이 스크립트의 내용은 다음과 같습니다.

#! /bin/sh
export PATH || exec /bin/sh "$0" $argv
# Get the path to this exec
setuploc=`dirname "$0"`

unset LANG
platform=`uname -s`

# run setup executable depending on different platform
if [ "$platform" = "Linux" ]
then
    machineType=`uname -m`; # Get the machine type
    if [ "$machineType" = "x86_64" ]
    then
    # 64 bit
        if [ -f "$setuploc/bin/lin64/xsetup" ]
        then
            "$setuploc/bin/lin64/xsetup" $*
        else
            if [ -f "$setuploc/bin/lin/xsetup" ]
            then
                "$setuploc/bin/lin/xsetup" $*
            else
                echo "Product is not supported on \"$platform\" platform."
            fi            
        fi
    else
        if [ -f "$setuploc/bin/lin/xsetup" ]
        then
            "$setuploc/bin/lin/xsetup" $*
        else
            echo "Product is not supported on \"$platform $machineType\" platform."
        fi
    fi
else
    echo "Un-supported platform: $platform"
fi

30번 라인이 첫 번째입니다.

"$setuploc/bin/lin/xsetup" $*

밑바닥부터

플랫폼

lm에 플래그가 하나 있으므로 Fedora 17, 64비트

grep lm /proc/cpuinfo:

 lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm 

답변1

에 대한 권한을 변경했습니다 /home/msz/xilinx/xsetup. 그러나 스크립트에 의해 호출되는 중첩 스크립트는 입니다 /home/msz/xilinx/bin/lin/xsetup. 올바른 파일에 대한 권한을 수정하십시오.

관련 정보