What does if [ $? -eq 0 ] mean for shell scripts? - Stack Overflow

What does if [ $? -eq 0 ] mean for shell scripts? - Stack Overflow

瀏覽:446
日期:2025-04-27
It's checking the return value ($?) of grep. In this case it's comparing it to 0 (success). Usually when you see something like this (checking the return value of grep) it's checking to see whether the particular string was detected. Although the redirect...看更多