Linux脚本简单语法解决方法

Linux脚本简单语法#!/bin/shif[ 11 ] thenecho 1fi异常:syntax error near unexpected token then躺着

Linux脚本简单语法
#!/bin/sh
if[ 1=1 ]; then
echo 1
fi

异常:syntax error near unexpected token 'then'

躺着也中枪?

[解决办法]
if和[之间加个空格。

[解决办法]
if [ 1=1 ]