shell 常规操作
#!/bin/sh
awk '
BEGIN { flag="none"; }
/^[ \t]*if/ {
flag="if";
print NR
next;
}
/^[ \t]*if/ {
flag="if";
print yy NR
}
' wqx_src1.sh
wqx_src1.sh
#!/bin/sh
echo "开始"
read key
if [ $key = "test" ]
then
if
then
} echo "好的"
else
echo "不好"
fi
for语句
#!/bin/bash
for var in A B C; do
echo "var is $var"
done
将内容写到另一个文件中
#!/bin/bash
echo "nihao" > old.sh