命令
echo
显示字符串
echo "hello world" echo hello world
显示转义字符
echo "This is \"Cool Bird\""
显示变量
name="Conan" echo "hello $name"
显示换行 使用-e参数
echo -e 'hello world\n' echo 'goodbye'
显示命令结果 使用反引号` `
echo `ls`
结果重定向
echo ok > text.txt
printf
test
在流程控制中需要传入condition的地方可以使用test
命令,类似于[ condition ]
这样的写法。
Last updated
Was this helpful?