han*_*xue 3 shell shell-script fish
我正在浏览鱼壳教程,发现这个简单的 if-else 块不起作用
if grep fish /etc/shells
echo Found fish
else if grep bash /etc/shells
echo Found bash
else
echo Got nothing
end
Run Code Online (Sandbox Code Playgroud)
错误信息:
/usr/bin/fish
Found fish
fish: global root block
fish: Could not locate end of block. The 'end' command is missing, misspelled or
a ';' is missing.
end - end a block of commands.
Run Code Online (Sandbox Code Playgroud)