代码搜索:bash
找到约 5,321 项符合「bash」的源代码
代码结果 5,321
www.eeworm.com/read/339483/12230722
sh ex70.sh
#!/bin/bash
wall <<zzz23EndOfMessagezzz23
E-mail your noontime orders for pizza to the system administrator.
(Add an extra dollar for anchovy or mushroom topping.)
# Additional message text
www.eeworm.com/read/339483/12230725
sh and-or.sh
#!/bin/bash
a=24
b=47
if [ "$a" -eq 24 ] && [ "$b" -eq 47 ]
then
echo "Test #1 succeeds."
else
echo "Test #1 fails."
fi
# ERROR: if [ "$a" -eq 24 && "$b" -eq 47 ]
#+ attempts to execu
www.eeworm.com/read/339483/12230791
sh subshell-pitfalls.sh
#!/bin/bash
# Pitfalls of variables in a subshell.
outer_variable=outer
echo
echo "outer_variable = $outer_variable"
echo
(
# Begin subshell
echo "outer_variable inside subshell = $outer_variable"
www.eeworm.com/read/339483/12230795
sh ex4.sh
#!/bin/bash
# "subst", a script that substitutes one pattern for
#+ another in a file,
#+ i.e., "subst Smith Jones letter.txt".
ARGS=3 # Script requires 3 arguments.
E_BADARGS=65 # Wrong
www.eeworm.com/read/339483/12230850
sh tempfile-name.sh
#!/bin/bash
# tempfile-name.sh: temp filename generator
BASE_STR=`mcookie` # 32-character magic cookie.
POS=11 # Arbitrary position in magic cookie string.
LEN=5 # Get
www.eeworm.com/read/339483/12230873
sh param-sub.sh
#!/bin/bash
# param-sub.sh
# Whether a variable has been declared
#+ affects triggering of the default option
#+ even if the variable is null.
username0=
echo "username0 has been declared, but is s
www.eeworm.com/read/339483/12231624
sh bashpodder.sh
#!/bin/bash
# bashpodder.sh:
# By Linc 10/1/2004
# Find the latest script at http://linc.homeunix.org:8080/scripts/bashpodder
# Last revision 12/14/2004 - Many Contributors!
# If you use this and hav
www.eeworm.com/read/339483/12231633
sh wh-loopc.sh
#!/bin/bash
# wh-loopc.sh: Count to 10 in a "while" loop.
LIMIT=10
a=1
while [ "$a" -le $LIMIT ]
do
echo -n "$a "
let "a+=1"
done # No surprises, so far.
echo; echo
# +==============
www.eeworm.com/read/339483/12231660
sh redir2.sh
#!/bin/bash
# redir2.sh
if [ -z "$1" ]
then
Filename=names.data # Default, if no filename specified.
else
Filename=$1
fi
#+ Filename=${1:-names.data}
# can replace the above test (parame
www.eeworm.com/read/339483/12231763
sh self-source.sh
#!/bin/bash
# self-source.sh: a script sourcing itself "recursively."
# From "Stupid Script Tricks," Volume II.
MAXPASSCNT=100 # Maximum number of execution passes.
echo -n "$pass_count "
# At