代码搜索:bash
找到约 5,321 项符合「bash」的源代码
代码结果 5,321
www.eeworm.com/read/339483/12230697
sh poem.sh
#!/bin/bash
# poem.sh: Pretty-prints one of the document author's favorite poems.
# Lines of the poem (single stanza).
Line[1]="I do not know which to prefer,"
Line[2]="The beauty of inflections"
Lin
www.eeworm.com/read/339483/12230711
sh grp.sh
#!/bin/bash
# grp.sh: Very crude reimplementation of 'grep'.
E_BADARGS=65
if [ -z "$1" ] # Check for argument to script.
then
echo "Usage: `basename $0` pattern"
exit $E_BADARGS
fi
echo
f
www.eeworm.com/read/339483/12230747
sh alt-bc.sh
#!/bin/bash
# Invoking 'bc' using command substitution
# in combination with a 'here document'.
var1=`bc
www.eeworm.com/read/339483/12230863
sh secret-pw.sh
#!/bin/bash
# secret-pw.sh: secret password
echo
echo -n "Enter password "
read passwd
echo "password is $passwd"
echo -n "If someone had been looking over your shoulder, "
echo "your password would
www.eeworm.com/read/339483/12231352
sh func-cmdlinearg.sh
#!/bin/bash
# func-cmdlinearg.sh
# Call this script with a command-line argument,
#+ something like $0 arg1.
func ()
{
echo "$1"
}
echo "First call to function: no arg passed."
echo "See if comma
www.eeworm.com/read/339483/12231432
sh ex14.sh
#!/bin/bash
# zmore
#View gzipped files with 'more'
NOARGS=65
NOTFOUND=66
NOTGZIP=67
if [ $# -eq 0 ] # same effect as: if [ -z "$1" ]
# $1 can exist, but be empty: zmore "" arg2 arg3
then
echo
www.eeworm.com/read/339483/12231445
sh rfe.sh
#!/bin/bash
# rfe.sh: Renaming file extensions.
#
# rfe old_extension new_extension
#
# Example:
# To rename all *.gif files in working directory to *.jpg,
# rfe gif jpg
E_BADARGS=6
www.eeworm.com/read/339483/12231471
sh rn.sh
#! /bin/bash
#
# Very simpleminded filename "rename" utility (based on "lowercase.sh").
#
# The "ren" utility, by Vladimir Lanin (lanin@csd2.nyu.edu),
#+ does a much better job of this.
ARGS=2
E_BA
www.eeworm.com/read/339483/12231618
sh sum-product.sh
#!/bin/bash
# sum-product.sh
# A function may "return" more than one value.
sum_and_product () # Calculates both sum and product of passed args.
{
echo $(( $1 + $2 )) $(( $1 * $2 ))
# Echoes to s