it-source

탭을 클릭하면 셸 초기화 문제가 발생합니다.getcwd의 문제점은 무엇입니까?

criticalcode 2023. 4. 16. 15:13
반응형

탭을 클릭하면 셸 초기화 문제가 발생합니다.getcwd의 문제점은 무엇입니까?

Bash에서 Tab을 클릭하면 오류 메시지가 나타납니다.무슨 일입니까?

symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: Success
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: Success
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: Success
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: Success
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: Success
symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: Success

에러 메시지는 다음과 같습니다.

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No s uch file or directory

셸 초기화 문제를 해결하는 방법

일반적으로 이 문제는 현재 디렉토리가 더 이상 존재하지 않을 때 발생합니다.대부분의 경우 다른 단말기에서 해당 디렉토리를 삭제합니다(스크립트 내 등).그 사이에 현재의 디렉토리가 재작성되었을 경우에 대비해, 이것을 없애려면 ,cd다른(기존) 디렉토리로 전송하여cd가장 간단한 것은 다음과 같습니다.cd; cd -.

디렉토리를 다른 디렉토리로 변경하고 돌아오기만 하면 됩니다.그것은 삭제 또는 이동되었을 가능성이 있습니다.

혹시, 오버레이를 사용하고 있는 디렉토리에서 이러한 현상이 발생하고 있습니까?FS(또는 기타 특수 파일 시스템 유형)

방금 이 문제가 있었는데 크로스 컴파일된 버전의 bash는 내부 구현을 사용합니다.getcwd오버레이에 문제가 있다FS. 여기에 대한 정보가 있습니다.

이는 bash에서 getcwd()의 내부 구현으로 추적될 수 있습니다.크로스 컴파일 시 malloc의 getcwd() 사용을 체크할 수 없기 때문에 주의하여 GETCWD_BROKNED를 설정하고 getcwd()의 내부 구현을 사용합니다.이 내부 구현은 오버레이와 함께 잘 작동하지 않는 것 같습니다.FS

http://permalink.gmane.org/gmane.linux.embedded.yocto.general/25204

bash를 설정하고 재구축할 수 있습니다.bash_cv_getcwd_malloc=yes(실제로 bash를 빌드 중이고 C 라이브러리가 getcwd 콜을 malloc하는 경우).

네, cd; 및 cd-로 동작합니다.그 이유는 디렉토리가 다른 단말기 또는 다른 프로그램에서 삭제되어 재생성되고 있기 때문입니다.따라서 i-node 엔트리가 수정되어 프로그램이 이전 i-node 엔트리에 액세스할 수 없습니다.

언급URL : https://stackoverflow.com/questions/12338233/shell-init-issue-when-click-tab-whats-wrong-with-getcwd

반응형