나는 원하는 것을 얻기 위해 무수한 방법을 시도했지만 아무것도 작동하지 않는 것 같습니다. 나는 항상 2:not found
과 같은 것으로 끝난다.ZSH에서 출력 명령 캡처 및 테스트
"!"
function test() {
local testv=$(command) 2>/dev/null
if [ $(#testv) == "!" ]; then
echo "Exclamation mark!"
else
echo "No exclamation mark."
fi
}
가 어떻게 오류
test:2: = not found
을 방지하기 위해 위의 코드를 다시 작성해야합니까?