代码搜索:bash
找到约 5,321 项符合「bash」的源代码
代码结果 5,321
www.eeworm.com/read/272978/10934285
sh calc.sh
#!/bin/bash
i=0;
while [ $i -lt 10000 ]
do
((i++))
done
echo $i
www.eeworm.com/read/458682/7291422
sh ex74.sh
#!/bin/bash
# ex74.sh
# This is a buggy script.
# Where, oh where is the error?
a=37
if [$a -gt 27 ]
then
echo $a
fi
exit 0
www.eeworm.com/read/458682/7291681
sh bashandperl.sh
#!/bin/bash
# bashandperl.sh
echo "Greetings from the Bash part of the script."
# More Bash commands may follow here.
exit 0
# End of Bash part of the script.
# ====================================
www.eeworm.com/read/458682/7291703
sh ex77.sh
#!/bin/bash
# String expansion.
# Introduced with version 2 of Bash.
# Strings of the form $'xxx'
#+ have the standard escaped characters interpreted.
echo $'Ringing bell 3 times \a \a \a'
#
www.eeworm.com/read/438832/7725347
sh recurse.sh
#!/bin/bash
# recurse.sh
# 脚本能否递归地调用自己?
# 是的, 但这有什么实际的用处吗?
# (看下面的.)
RANGE=10
MAXVAL=9
i=$RANDOM
let "i %= $RANGE" # 在0到$RANGE - 1之间, 产生一个随机数.
if [ "$i" -lt "$MAXVAL" ]
then
echo "i = $i"
www.eeworm.com/read/438832/7725801
sh arith-tests.sh
#!/bin/bash
# 算术测试.
# (( ... ))结构可以用来计算并测试算术表达式的结果.
# 退出状态将会与[ ... ]结构完全相反!
(( 0 ))
echo "Exit status of \"(( 0 ))\" is $?." # 1
(( 1 ))
echo "Exit status of \"(( 1 ))\" is $?." #
www.eeworm.com/read/438832/7725805
sh redir5.sh
#!/bin/bash
if [ -z "$1" ]
then
Filename=names.data # 如果文件名没有指定, 使用默认值.
else
Filename=$1
fi
TRUE=1
if [ "$TRUE" ] # if true 和 if : 都可以.
then
read name
echo $name
fi
www.eeworm.com/read/198531/7930962
sh openvpn-shutdown.sh
#!/bin/bash
# stop all openvpn processes
killall -TERM openvpn
www.eeworm.com/read/331567/12820190
sh addheader.sh
#!/bin/bash
sed -n '$p' $1 > header.tmp
cat header.tmp $2 > "$2".tmp
mv -f "$2".tmp "$2"
rm -f header.tmp
www.eeworm.com/read/329257/12966999
txt ch21.txt
Chapter 21
-------------------------
Overriding Default Values
-------------------------
#!/bin/bash
if [ "$#" -eq 2 ]
then
mail -s $1 bob@mycomputer mary@mycomputer < $2
elif [ "