代码搜索:bash
找到约 5,321 项符合「bash」的源代码
代码结果 5,321
www.eeworm.com/read/192357/8384857
stresstest
#! /bin/bash
BR=${1:-"br549"}
ETH0=${2:-"eth0"}
ETH1=${3:-"eth1"}
ETH2=${4:-"eth1"}
echo "Ethernet Bridge stress test"
IP=`/sbin/ifconfig $ETH0 | sed -n -e 's/^.*inet addr:\([0-9][0-9\.]*\).*$/\1/p
www.eeworm.com/read/365809/9845718
stresstest
#! /bin/bash
BR=${1:-"br549"}
ETH0=${2:-"eth0"}
ETH1=${3:-"eth1"}
ETH2=${4:-"eth1"}
echo "Ethernet Bridge stress test"
IP=`/sbin/ifconfig $ETH0 | sed -n -e 's/^.*inet addr:\([0-9][0-9\.]*\).*$/\1/p
www.eeworm.com/read/438832/7725308
sh ex7.sh
#!/bin/bash
var1=abcd-1234-defg
echo "var1 = $var1"
t=${var1#*-*}
echo "var1 (with everything, up to and including first - stripped out) = $t"
# t=${var1#*-} 也一样,
#+ 因为#匹配最短的字符串,
#+ 同时*匹配任意前缀, 包括空
www.eeworm.com/read/438832/7725322
sh agram2.sh
#!/bin/bash
# agram2.sh
# 关于命令替换嵌套的例子.
# 使用"anagram"工具.
#+ 这是作者的"yawl"文字表软件包中的一部分.
# http://ibiblio.org/pub/Linux/libs/yawl-0.3.2.tar.gz
# http://personal.riverusers.com/~thegrendel/yawl-0.3.2.
www.eeworm.com/read/438832/7725423
sh ex79.sh
#!/bin/bash
# 纸牌:
# 处理4人打牌.
UNPICKED=0
PICKED=1
DUPE_CARD=99
LOWER_LIMIT=0
UPPER_LIMIT=51
CARDS_IN_SUIT=13
CARDS=52
declare -a Deck
declare -a Suits
declare -a Cards
# 使用一个3维数组来代替这3个一维数组来描述数据,
www.eeworm.com/read/438832/7725755
sh ex58.sh
#!/bin/bash
# 在一个"tarball"中(经过tar和gzip处理过的文件)
#+ 备份最后24小时当前目录下d所有修改的文件.
BACKUPFILE=backup-$(date +%m-%d-%Y)
# 在备份文件中嵌入时间.
# Thanks, Joshua Tschida, for the idea.
ar
www.eeworm.com/read/438832/7725782
sh rfe.sh
#!/bin/bash
# rfe.sh: 修改文件扩展名.
#
# 用法: rfe old_extension new_extension
#
# 示例:
# 将指定目录中所有的*.gif文件都重命名为*.jpg,
# 用法: rfe gif jpg
E_BADARGS=65
case $# in
0|1) # 竖线"|"在这里表示"或"操作.
echo
www.eeworm.com/read/438832/7725795
sh upperconv.sh
#!/bin/bash
# upperconv.sh
# 将一个指定的输入文件转换为大写.
E_FILE_ACCESS=70
E_WRONG_ARGS=71
if [ ! -r "$1" ] # 判断指定的输入文件是否可读?
then
echo "Can't read from input file!"
echo "Usage: $0 input-file output-f
www.eeworm.com/read/438832/7725800
sh reply.sh
#!/bin/bash
# reply.sh
# REPLY是提供给'read'命令的默认变量.
echo
echo -n "What is your favorite vegetable? "
read
echo "Your favorite vegetable is $REPLY."
# 当且仅当没有变量提供给"read"命令时,
#+ REPLY才保存最后一个"read"命令读入的