小编Bob*_*oby的帖子

如何在bash shell脚本变量中查找子字符串

我有一个如下变量.

variable = This script is not found

if [[ "$variable" = ~ "not found" ]];
then
echo "Not Found"
else
echo "Its there"
if
Run Code Online (Sandbox Code Playgroud)

执行即时通讯低于错误,

line 4: syntax error in conditional expression
./test.sh: line 4: syntax error near `found"'
./test.sh: line 4: `if [[ "$variable" = ~ "not found" ]]; '
Run Code Online (Sandbox Code Playgroud)

谁能指出我,我在这里失踪了什么?

bash shell

10
推荐指数
2
解决办法
4万
查看次数

标签 统计

bash ×1

shell ×1