代码搜索:bash
找到约 5,321 项符合「bash」的源代码
代码结果 5,321
www.eeworm.com/read/458682/7291351
sh ex12.sh
#!/bin/bash
filename=sys.log
cat /dev/null > $filename; echo "Creating / cleaning out file."
# Creates file if it does not already exist,
#+ and truncates it to zero length if it does.
# : > filen
www.eeworm.com/read/458682/7291355
sh self-destruct.sh
#!/bin/bash
# self-destruct.sh
kill $$ # Script kills its own process here.
# Recall that "$$" is the script's PID.
echo "This line will not echo."
# Instead, the shell sends a "Terminated
www.eeworm.com/read/458682/7291371
sh ind-ref.sh
#!/bin/bash
# ind-ref.sh: Indirect variable referencing.
# Accessing the contents of the contents of a variable.
a=letter_of_alphabet # Variable "a" holds the name of another variable.
letter_of_al
www.eeworm.com/read/458682/7291380
sh ex51.sh
#!/bin/bash
# Exercising the 'date' command
echo "The number of days since the year's beginning is `date +%j`."
# Needs a leading '+' to invoke formatting.
# %j gives day of year.
echo "The number o
www.eeworm.com/read/458682/7291398
sh setnew-passwd.sh
#!/bin/bash
# setnew-password.sh: For demonstration purposes only.
# Not a good idea to actually run this script.
# This script must be run as root.
ROOT_UID=0 # Root h
www.eeworm.com/read/458682/7291401
sh rpm-check.sh
#!/bin/bash
# rpm-check.sh
# Queries an rpm file for description, listing,
#+ and whether it can be installed.
# Saves output to a file.
#
# This script illustrates using a code block.
SUCCESS=0
www.eeworm.com/read/458682/7291421
sh random2.sh
#!/bin/bash
# random2.sh: Returns a pseudorandom number in the range 0 - 1.
# Uses the awk rand() function.
AWKSCRIPT=' { srand(); print rand() } '
# Command(s) / parameters passed to awk
www.eeworm.com/read/458682/7291429
sh pr-asc.sh
#!/bin/bash
# pr-ascii.sh: Prints a table of ASCII characters.
START=33 # Range of printable ASCII characters (decimal).
END=125
echo " Decimal Hex Character" # Header.
echo " ------- --
www.eeworm.com/read/458682/7291447
sh array-function.sh
#!/bin/bash
# array-function.sh: Passing an array to a function and...
# "returning" an array from a function
Pass_Array ()
{
local passed_array # Local variable.
passed_arra
www.eeworm.com/read/458682/7291477
sh encryptedpw.sh
#!/bin/bash
# Example "ex72.sh" modified to use encrypted password.
# Note that this is still rather insecure,
#+ since the decrypted password is sent in the clear.
# Use something like "ssh" if t