13. 07.
Bash While Loop Example - Bash While 循环实例
Q. How do I use bash while loop to repeat certain task under Linux / UNIX operating system?
A. Bash while loop is a control flow statement that allows code or commands to be executed repeatedly based on a given condition. For example, run echo command 5 times or read text file line by line or evaluate the options passed on the command line for a script.
while loop syntax
阅读全文 »
28. 05.
如果你习惯了linux下的bash, 可能sh会叫你有点不舒服, 只是可能, 其实习惯了就好, 关于freebsd下bash的安装和配置, 写了一个简单的步骤:
Freebsd默认安装之后用户的shell是sh,如果都已经习惯了使用bash。通过下面的步骤可以配置用户来使用bash作为shell。
1. 安装bash。 cd /usr/ports/shells/bash; make install clean
这样安装完之后,bash会被安装在/usr/local/bin/目录下面。
2. 在/bin目录下面做一个符号连接。
ln -s /usr/local/bin/bash /bin/bash
3. 修改 /etc/shells文件,将bash增加进去,
添加一行:/bin/bash 就可以了
hao32