Hello, I am very new to shell scripting. This problem seems quite easy so it should be quite easy (I hope ^^)
I want to get a random file from a directory. this file will be in one subdirectory, and it will contain spaces.
code I have got so far:
N=find ./*/*.jpg | wc -l
((N=RANDOM%N))
... (6 Replies)
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)
Hi there folks,
for an exercise for my pupils (you know i am always thinking of them!) i need to randomly re-arrange the words (blank space separated) in a sentence (a line in a textfile). Any inspiration??
Txk so much. (9 Replies)
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)
Over the last month or so my CentOS server has been crashing for reasons I do not know. It has been running for over a year with regular yum updates without problems. The load on the server is perfectly normal with CPU usage at 5-6% and RAM usage at less than half of 32GB of RAM (multiple smaller... (3 Replies)
Hi,
Could you please let me know what the following code does, I know that it means generating random numbers, however not sure what is the entire purpose.
R=$(($RANDOM % 2))
delay=$(($RANDOM % 10))
if
then
TEXT='X'
else
... (3 Replies)
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)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
Write a shell script that will take the sum of two random number?
Ex: Random n1 +Random n2 = result
i tries to write it but i had some dufficulties
... (3 Replies)
Discussion started by: renegade755
3 Replies
LEARN ABOUT DEBIAN
randtype
randtype(1) General Commands Manual randtype(1)NAME
randtype - Output characters or lines at random intervals
SYNOPSIS
randtype [ -l ] [ -d ,|.<string> [ -k ] ] [ -t <ms,mult> ] [ -w <string> [ -c ms,mult ] ] [ -r s1,s2[:...] ] [ -n <string> ] [ -q <int> ]
[ -m <int> ] [ file ... ]
DESCRIPTION
randtype reads input from either standard input or from a file and outputs each character or line at random intervals. If multiple files
are specified, each is read in sequence.
OPTIONS
randtype recognizes the following command line options:
-c ms,mult
For optional use with the -w option, this has the same microsecond and multiplier value format as the -t option. The default for
this option is specified at compile time.
-d string
Output everything before (left) or after (right) the specified string immediately. The string must begin with either ',' or '.'
which specifies the direction, left or right, respectively.
-h Print a summary of the command line options and exit.
-k Suppress output of the string specified by the dump string option.
-l Output lines rather than characters. Only the -t and -q options are valid when using this option, all other options are ignored.
-m int Generate random mistakes. The int value is how many times to compare and match the next character and a randomly generated charac-
ter.
-n chars
Output the specified characters immediately with no random waiting.
-r s1,s2[:...]
Replace the string s1 with string s2. You can specify multiple replacements by separating them with a ':'.
-q int Quit the program after this many seconds.
-t ms,mult
This option refines the random delay of output. The value of the argument is separated by a comma with the first argument being a
microsecond and the second being a multiplier of a random number between 0 and the microsecond. A character-per-second effect can,
for example, be made by setting the microsecond to 0 and the multiplier to 1000000. The default for this option is specified at com-
pile time.
-v Display version information and exit.
-w chars
The inverse of the -n option; this option waits on the specified characters. Use the -c option to refine the random delay of output.
EXAMPLE
randtype -t 13,16000 -d ",*MAGIC*" -k -n '0ou' filename
SEE ALSO random(3), srandom(3), alarm(2), select(2)AUTHOR
This program was created by bjk <bjk@arbornet.org> and released under the terms of the GNU General Public License version 2 or later.
randtype randtype(1)