ubuntu shell编程

    今天被一个shell命令的if语句给搞懵了,不知道错在哪里,如下

#!/bin/bash

echo "please enter your selection: A or B"
read var
echo "you selected $var"

if [ "$var" = "A" ]; then
echo "your selection is A"
else if [ "$var" = "B" ]; then
echo "your selection is B"
else
echo "beyond the boundaries of your choice";
fi

然后 执行的时候一直报错: syntax error: unexpected end of file。看了语法,没什么问题啊,帮助文档就这么要求的。只能google了,最后修改了粗字体的“else if” 为“elif”,我发现可以了。这ubuntu的帮助文档真是的。。。

压缩解压缩:

http://www.doc88.com/p-015651399852.html感觉这个比较好,标记下。

这种格式是我使用得最多的压缩格式。它在压缩时不会占用太多CPU的,而且可以得到一个非常理想的压缩率。

这种压缩格式是我们提到的所有方式中压缩率最好的。当然,这也就意味着,它比前面的方式要占用更多的CPU与时间。

原文地址:https://www.cnblogs.com/playerboy/p/3135305.html