我正在尝试使用 Bourne Shell (sh) 确定某个特定单词是否出现在句子中。例如:
#!/bin/bash
INPUT='Lorem ipsum dolor sit amet.'
if [[ "$INPUT" == *dolor* ]]
then
echo "So true"
else
echo "Not true"
fi
Run Code Online (Sandbox Code Playgroud)
这适用于bash,但我不能使用bash,我需要一些适用于sh