11-20-2002
Code :
#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 2002-11-20 11:30 PST
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
# 549 -rw------- ex1_lst
# 507 -rw------- ex2_lst
# 314 -rw------- ex3_lst
# 86 -rw------- ex4_lst
# 950 -rwx------ excuse
# 1002 -rwx------ excuse.web
# 571 -rwx------ serve_exc
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
if test "$gettext_dir" = FAILED && test -f $dir/gettext \
&& ($dir/gettext --version >/dev/null 2>&1)
then
set `$dir/gettext --version 2>&1`
if test "$3" = GNU
then
gettext_dir=$dir
fi
fi
if test "$locale_dir" = FAILED && test -f $dir/shar \
&& ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
then
locale_dir=`$dir/shar --print-text-domain-dir`
fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
echo=echo
else
TEXTDOMAINDIR=$locale_dir
export TEXTDOMAINDIR
TEXTDOMAIN=sharutils
export TEXTDOMAIN
echo="$gettext_dir/gettext -s"
fi
if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then
shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then
shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then
shar_touch='touch -am $3$4$5$6$2 "$8"'
else
shar_touch=:
echo
$echo 'WARNING: not restoring timestamps. Consider getting and'
$echo "installing GNU \`touch', distributed in GNU File Utilities..."
echo
fi
rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch
#
if mkdir _sh26541; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
exit 1
fi
# ============= ex1_lst ==============
if test -f 'ex1_lst' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'ex1_lst' '(file already exists)'
else
$echo 'x -' extracting 'ex1_lst' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'ex1_lst' &&
Temporary
Intermittant
Partial
Redundant
Total
Multiplexed
Inherent
Duplicated
Dual-Homed
Synchronous
Bidirectional
Serial
Asynchronous
Multiple
Replicated
Non-Replicated
Unregistered
Non-Specific
Generic
Migrated
Localised
Resignalled
Dereferenced
Nullified
Aborted
Serious
Minor
Major
Extraneous
Illegal
Insufficient
Viral
Unsupported
Outmoded
Legacy
Permanent
Invalid
Deprecated
Virtual
Unreportable
Undetermined
Undiagnosable
Unfiltered
Static
Dynamic
Delayed
Immediate
Nonfatal
Fatal
Non-Valid
Unvalidated
Non-Static
Unreplicatable
Non-Serious
SHAR_EOF
(set 20 02 11 13 11 45 14 'ex1_lst'; eval "$shar_touch") &&
chmod 0600 'ex1_lst' ||
$echo 'restore of' 'ex1_lst' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'ex1_lst:' 'MD5 check failed'
00aecd2e37a5ddb28f14718ff212b9f6 ex1_lst
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'ex1_lst'`"
test 549 -eq "$shar_count" ||
$echo 'ex1_lst:' 'original size' '549,' 'current size' "$shar_count!"
fi
fi
# ============= ex2_lst ==============
if test -f 'ex2_lst' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'ex2_lst' '(file already exists)'
else
$echo 'x -' extracting 'ex2_lst' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'ex2_lst' &&
Array
Systems
Hardware
Software
Firmware
Backplane
Logic-Subsystem
Integrity
Subsystem
Memory
Comms
Integrity
Checksum
Protocol
Parity
Bus
Timing
Synchronisation
Topology
Transmission
Reception
Stack
Framing
Code
Programming
Peripheral
Environmental
Loading
Operation
Parameter
Syntax
Initialisation
Execution
Resource
Encryption
Decryption
File
Precondition
Authentication
Paging
Swapfile
Service
Gateway
Request
Proxy
Media
Registry
Configuration
Metadata
Streaming
Retrieval
Installation
Library
Handler
SHAR_EOF
(set 20 02 11 13 11 46 46 'ex2_lst'; eval "$shar_touch") &&
chmod 0600 'ex2_lst' ||
$echo 'restore of' 'ex2_lst' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'ex2_lst:' 'MD5 check failed'
09e966a2adba5158ba54b6af16a25419 ex2_lst
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'ex2_lst'`"
test 507 -eq "$shar_count" ||
$echo 'ex2_lst:' 'original size' '507,' 'current size' "$shar_count!"
fi
fi
# ============= ex3_lst ==============
if test -f 'ex3_lst' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'ex3_lst' '(file already exists)'
else
$echo 'x -' extracting 'ex3_lst' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'ex3_lst' &&
Interruption
Destabilisation
Destruction
Desynchronisation
Failure
Dereferencing
Overflow
Underflow
NMI
Interrupt
Corruption
Anomoly
Seizure
Override
Reclock
Rejection
Invalidation
Halt
Exhaustion
Infection
Incompatibility
Timeout
Expiry
Unavailability
Bug
Condition
Crash
Dump
Crashdump
Stackdump
Problem
Lockout
SHAR_EOF
(set 20 02 11 13 11 48 15 'ex3_lst'; eval "$shar_touch") &&
chmod 0600 'ex3_lst' ||
$echo 'restore of' 'ex3_lst' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'ex3_lst:' 'MD5 check failed'
6281886225b51332f25e27db12d04c66 ex3_lst
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'ex3_lst'`"
test 314 -eq "$shar_count" ||
$echo 'ex3_lst:' 'original size' '314,' 'current size' "$shar_count!"
fi
fi
# ============= ex4_lst ==============
if test -f 'ex4_lst' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'ex4_lst' '(file already exists)'
else
$echo 'x -' extracting 'ex4_lst' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'ex4_lst' &&
Error
Problem
Warning
Signal
Flag
Issue
Connundrum
Complication
Diagnostic
Exhaustion
SHAR_EOF
(set 20 02 11 14 15 54 58 'ex4_lst'; eval "$shar_touch") &&
chmod 0600 'ex4_lst' ||
$echo 'restore of' 'ex4_lst' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'ex4_lst:' 'MD5 check failed'
1712d7a60fa5844c03a5ef197e435215 ex4_lst
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'ex4_lst'`"
test 86 -eq "$shar_count" ||
$echo 'ex4_lst:' 'original size' '86,' 'current size' "$shar_count!"
fi
fi
# ============= excuse ==============
if test -f 'excuse' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'excuse' '(file already exists)'
else
$echo 'x -' extracting 'excuse' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'excuse' &&
#! /bin/ksh
X
fil1_len=$(wc -l < ex1_lst)
X linenum=$((RANDOM%fil1_len+1))
X var1=$(sed -n "${linenum}p" ex1_lst)
X
fil2_len=$(wc -l < ex2_lst)
X linenum=$((RANDOM%fil2_len+1))
X var2=$(sed -n "${linenum}p" ex2_lst)
X
((RANDOM%2)) || {
X fil3_len=$(wc -l < ex2_lst)
X linenum=$((RANDOM%fil3_len+1))
X var3=$(sed -n "${linenum}p" ex2_lst)
X [[ $var3 == $var2 ]] && var3=""
X }
X
fil4_len=$(wc -l < ex3_lst)
X linenum=$((RANDOM%fil4_len+1))
X var4=$(sed -n "${linenum}p" ex3_lst)
X
fil5_len=$(wc -l < ex4_lst)
X linenum=$((RANDOM%fil5_len+1))
X var5=$(sed -n "${linenum}p" ex4_lst)
X
typeset -L1 -l comp=$var1
X [[ $comp == ?([aeiou]) ]] && { conj=an; } || { conj=a; }
X
clear
print "
**************************************
**************************************
X
X Excuse Calendar - $(date +%D)
X
**************************************
**************************************
"
print The problem appears to be caused by $conj $var1 $var2 $var3 $var4 $var5
print
X
SHAR_EOF
(set 20 02 11 14 14 34 49 'excuse'; eval "$shar_touch") &&
chmod 0700 'excuse' ||
$echo 'restore of' 'excuse' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'excuse:' 'MD5 check failed'
353fcaf0f218625560068a2feb16194a excuse
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'excuse'`"
test 950 -eq "$shar_count" ||
$echo 'excuse:' 'original size' '950,' 'current size' "$shar_count!"
fi
fi
Continued on next post...
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
My problem is as follow and i hope you can help:
I currently have this function:
stored_word()
{
number=$RANDOM
let "number %= 21"
case $number in
0 ) echo "energy" ;; 1 ) echo "touch" ;;
2 ) echo "climbing" ;; 3 ) echo "declare" ;;
4 ) echo "marry" ;; 5 ) echo "relax" ... (8 Replies)
Discussion started by: keyvan
8 Replies
2. Shell Programming and Scripting
I need to use the $RANDOM command to get a line from a list of lines in a file randomly.
file is
help
go
three
house
film
how do i randomly get one word without looking into the file? (6 Replies)
Discussion started by: relle
6 Replies
3. Shell Programming and Scripting
I have a text file with hundreds of lines, i wish to run a script and reads a random line to pass it to another command line such as:
for line in `cat file |grep random line`; do echo $line |mail my@example.com ; done
thank you (6 Replies)
Discussion started by: Bashar
6 Replies
4. Ubuntu
Hi
I am new to expect. Please if any one can help on my issue its really appreciable. here is my issue:
I want expect script for random passwords and random commands generation.
please can anyone help me?
Many Thanks in advance (0 Replies)
Discussion started by: vanid
0 Replies
5. Shell Programming and Scripting
Hi experts,
My csv file looks like this
U;cake;michael;temp;;;;
U;bread;john;temp;;;;
U;cocktails;sarah;temp;;;;
I'd like to change the value fo 2nd column to cf+random number , which will look maybe something like this
U;cf20187;michael;temp;;;;
U;cf8926;john;temp;;;;... (7 Replies)
Discussion started by: tententen
7 Replies
6. Shell Programming and Scripting
I have a file that needs to be parsed into multiple files every time there line contains a number 1. the problem i face is the lines are random and the file size is random. an example is that on line 4, 65, 187, 202 & 209 are number 1's so there has to be file breaks between all those to create 4... (6 Replies)
Discussion started by: darbs121
6 Replies
7. Shell Programming and Scripting
Need to use dd to generate a large file from a sample file of random data. This is because I don't have /dev/urandom.
I create a named pipe then:
dd if=mynamed.fifo do=myfile.fifo bs=1024 count=1024
but when I cat a file to the fifo that's 1024 random bytes:
cat randomfile.txt >... (7 Replies)
Discussion started by: Devyn
7 Replies
8. UNIX for Dummies Questions & Answers
Hello
I created 3 files by:
dd if=/dev/urandom bs=1024 count=1000000 of=./testfile1
dd if=/dev/urandom bs=1024 count=5000000 of=./testfile2
dd if=/dev/urandom bs=1024 count=10000000 of=./testfile3
Now I want to know how to make a change in a specific byte and/or line of theses files? (2 Replies)
Discussion started by: frhling
2 Replies
9. Shell Programming and Scripting
I have a file contains thousands of lines. I want to insert n random numbers into each line at
specific position. Like this:
0 22……
1 33……
……
……
I want to insert 3 random numbers from position 2 to 4 into each line.
0 325 22……
1 685 33……
……
……
Please use CODE tags when... (8 Replies)
Discussion started by: hhdzhu
8 Replies
10. UNIX for Beginners Questions & Answers
Input file:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 (6 Replies)
Discussion started by: Sagar Singh
6 Replies