代码搜索:bash
找到约 5,321 项符合「bash」的源代码
代码结果 5,321
www.eeworm.com/read/438832/7725306
sh self-document.sh
#!/bin/bash
# self-document.sh: 自文档化(self-documenting)的脚本
# 修改于"colm.sh".
DOC_REQUEST=70
if [ "$1" = "-h" -o "$1" = "--help" ] # 请求帮助.
then
echo; echo "Usage: $0 [directory-name]"; echo
se
www.eeworm.com/read/438832/7725346
sh seeding-random.sh
#!/bin/bash
# seeding-random.sh: 设置RANDOM变量作为种子.
MAXCOUNT=25 # 决定产生多少个随机数.
random_numbers ()
{
count=0
while [ "$count" -lt "$MAXCOUNT" ]
do
number=$RANDOM
echo -n "$number "
let "count
www.eeworm.com/read/438832/7725356
sh usrmnt.sh
#!/bin/bash
# usrmnt.sh, 由Anthony Richardson编写,
# 经过作者授权, 可以在本书中使用.
# 用法: usrmnt.sh
# 描述: 挂载设备, 调用这个脚本的用户必须属于
# /etc/sudoers文件中的MNTUSERS组.
# -----------------------------------
www.eeworm.com/read/438832/7725381
sh pr-asc.sh
#!/bin/bash
# pr-ascii.sh: 打印ASCII码的字符表.
START=33 # 可打印的ASCII字符的范围(十进制).
END=125
echo " Decimal Hex Character" # 表头.
echo " ------- --- ---------"
for ((i=START; i
www.eeworm.com/read/438832/7725431
sh viewdata.sh
#!/bin/bash
# viewdata.sh
# 转换自VIEWDATA.BAT的shell脚本.
DATAFILE=/home/bozo/datafiles/book-collection.data
ARGNO=1
# @ECHO OFF 这个命令在这里就不需要了.
if [ $# -lt "$ARGNO" ] # IF !%1==! GOT
www.eeworm.com/read/438832/7725744
sh here-function.sh
#!/bin/bash
# here-function.sh
GetPersonalData ()
{
read firstname
read lastname
read address
read city
read state
read zipcode
} # 这个函数看起来就是一个交互函数, 但是...
# 给上边的函数提供输入.
GetPersonalDa
www.eeworm.com/read/438832/7725754
sh ex21.sh
#!/bin/bash
# 每次调用$RANDOM都会返回不同的随机整数.
# 一般范围为: 0 - 32767 (有符号的16-bit整数).
MAXCOUNT=10
count=1
echo
echo "$MAXCOUNT random numbers:"
echo "-----------------"
while [ "$count" -le $MAXCOUNT ] #
www.eeworm.com/read/438832/7725799
sh ex44.sh
#!/bin/bash
# 结束ppp进程来强制登出log-off.
# 本脚本应该以root用户的身份来运行.
killppp="eval kill -9 `ps ax | awk '/ppp/ { print $1 }'`"
# -------- ppp的进程ID -------
$killppp # 这个变量
www.eeworm.com/read/438832/7725849
sh dict-lookup.sh
#!/bin/bash
# dict-lookup.sh
# 这个脚本在1913年的韦氏词典中查找定义.
# 这本公共词典可以通过不同的
#+ 站点来下载,包括
#+ Project Gutenberg (http://www.gutenberg.org/etext/247).
#
www.eeworm.com/read/438832/7725885
sh symlinks.sh
#!/bin/bash
# symlinks.sh: 列出目录中所有的符号链接文件.
directory=${1-`pwd`}
# 如果没有其他特殊的指定,
#+ 默认为当前工作目录.
# 下边的代码块, 和上边这句等价.
# ----------------------------------------------------------
# ARGS=1