Sponsored Content
Full Discussion: Random variables
Top Forums Shell Programming and Scripting Random variables Post 302624415 by digitalviking on Monday 16th of April 2012 08:44:28 AM
Old 04-16-2012
Random variables

I need to create a random String to save in a variable.

Code:
var=`??????`

So I want to replace ?????? with random 8 chars for instance:

is96789h

only letters and numbers

Is there an easy way to do this?

Thanks as always

DV
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Random

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

$random

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. Programming

How to convert byteArray variables to HexaString variables for Linux?

Hello everybody, I am having problem in converting byte array variables to Hexa String variables for Linux. I have done, converting byte array variables to Hexa String variables for Windows but same function doesn't work for linux. Is there any difference in OS ? The code for Windows is given... (2 Replies)
Discussion started by: ritesh_163
2 Replies

4. UNIX for Dummies Questions & Answers

random words

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)
Discussion started by: eldeingles
9 Replies

5. Ubuntu

expect script for random password and random commands

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

6. Shell Programming and Scripting

Need to generate a file with random data. /dev/[u]random doesn't exist.

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

7. Shell Programming and Scripting

Running a script with multiple variables like 25 variables.

Hi All, i have a requirement where i have to run a script with at least 25 arguements and position of arguements can also change. the unapropriate way is like below. can we achieve this in more good and precise way?? #!/bin/ksh ##script is sample.ksh age=$1 gender=$2 class=$3 . . .... (3 Replies)
Discussion started by: Lakshman_Gupta
3 Replies

8. Shell Programming and Scripting

BASH arrays and variables of variables in C++

Sometimes it is handy to protect long scripts in C++. The following syntax works fine for simple commands: #define SHELLSCRIPT1 "\ #/bin/bash \n\ echo \"hello\" \n\ " int main () { cout <<system(SHELLSCRIPT1); return 0; } Unfortunately for there are problems for: 1d arrays:... (10 Replies)
Discussion started by: frad
10 Replies

9. Shell Programming and Scripting

Passing awk variables to bash variables

Trying to do so echo "111:222:333" |awk -F: '{system("export TESTO=" $2)}'But it doesn't work (2 Replies)
Discussion started by: urello
2 Replies

10. UNIX for Dummies Questions & Answers

How to pass variables into anothother variables?

Below are three variables, which I want to pass into variable RESULT1 username1=userid poihostname1=dellsys.com port1=8080 How can I pass these variables into below code... RESULT1=$((ssh -n username1@poihostname1 time /usr/sfw/bin/wget --user=sam --password=123 -O /dev/null -q... (4 Replies)
Discussion started by: manohar2013
4 Replies
Math::Random::ISAAC::PP(3pm)				User Contributed Perl Documentation			      Math::Random::ISAAC::PP(3pm)

NAME
Math::Random::ISAAC::PP - Pure Perl port of the ISAAC PRNG algorithm VERSION
version 1.003 SYNOPSIS
This module implements the same interface as "Math::Random::ISAAC" and can be used as a drop-in replacement. However, it is recommended that you let the "Math::Random::ISAAC" module decide whether to use the PurePerl or XS version of this module, instead of choosing manually. Selecting the backend to use manually really only has two uses: o If you are trying to avoid the small overhead incurred with dispatching method calls to the appropriate backend modules. o If you are testing the module for performance and wish to explicitly decide which module you would like to use. Example code: # With Math::Random::ISAAC my $rng = Math::Random::ISAAC->new(time); my $rand = $rng->rand(); # With Math::Random::ISAAC::PP my $rng = Math::Random::ISAAC::PP->new(time); my $rand = $rng->rand(); DESCRIPTION
See Math::Random::ISAAC for the full description. METHODS
new Math::Random::ISAAC::PP->new( @seeds ) Implements the interface as specified in "Math::Random::ISAAC" rand $rng->rand() Implements the interface as specified in "Math::Random::ISAAC" irand $rng->irand() Implements the interface as specified in "Math::Random::ISAAC" SEE ALSO
Math::Random::ISAAC BUGS
Please report any bugs or feature requests on the bugtracker website http://rt.cpan.org/NoAuth/Bugs.html?Dist=Math-Random-ISAAC When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. AUTHOR
Jonathan Yu <jawnsy@cpan.org> COPYRIGHT AND LICENSE
Legally speaking, this package and its contents are: Copyright (c) 2011 by Jonathan Yu <jawnsy@cpan.org>. But this is really just a legal technicality that allows the author to offer this package under the public domain and also a variety of licensing options. For all intents and purposes, this is public domain software, which means you can do whatever you want with it. The software is provided "AS IS", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software. perl v5.10.1 2011-02-13 Math::Random::ISAAC::PP(3pm)
All times are GMT -4. The time now is 07:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy