linux_shell 第一章 变量

#!/bin/sh          //解释器
a="1";             //对a进行赋值,等号两边不能有空格,以冒号("")方式传入,变量不需要先定义即可使用
b="2;"
string="this is test";

echo $a;          //输出时要在变量前加$,这样才能看到a变量中存的值,以下同理
echo $b;
printf "$string \n\r";

主要是shell变量方面最最基本的应用.

你可能感兴趣的:(linux,shell,脚本)