![](/img/trans.png)
[英]Linux shell commands not found even though their paths are listed in the PATH variable
[英]Linux program only answers no even though a shell variable name exist
我編寫了以下程序來查找有效的shell變量名稱。 即使shell變量存在,我在運行程序時總是得到否定的答案。 這是代碼:
if [ -n "$(echo $1 | grep "^[_A-Za-z][_A-Za-z0-9]*$")" ]
then
echo yes
else
echo no
fi
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.