Sponsored Content
Full Discussion: mod on %RANDOM
Top Forums Shell Programming and Scripting mod on %RANDOM Post 302271839 by radoulov on Sunday 28th of December 2008 03:53:11 PM
Old 12-28-2008
Code:
$ m=50  
$ for i in {1..20};do print $(($RANDOM%$m+1));done      
4
31
11
4
50
16
12
6
44
39
40
26
23
42
41
8
44
20
47
36

 

3 More Discussions You Might Find Interesting

1. Programming

Mod

I try to use mod(a,b) in a program but i cant Please help me (2 Replies)
Discussion started by: iwbasts
2 Replies

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

3. 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
Extratags(3pm)						User Contributed Perl Documentation					    Extratags(3pm)

NAME
CGI::Extratags - Useful Extensions for the CGI Module SYNOPSIS
use CGI::Extratags; $cgi = new CGI::Extratags; print $cgi -> email ('racke@linuxia.de'); print $cgi -> jump ('CONTACT', 'contact us'); print $cgi -> mark ('CONTACT', $cgi -> h2 ('How to contact us')); print $cgi -> row ('Date', 18, 1, 1966); print $cgi -> recall ('Debian CD', artnum => '0-123456'); DESCRIPTION
CGI::Extratags adds several useful methods to the CGI class. email ADDRESS print $cgi -> email ('racke@linuxia.de'); Produces HTML code for a link to an email ADDRESS. jump MARK TEXT print $cgi -> jump ('CONTACT', 'contact us'); Produces HTML code for a link pointing to a target within the current document. mark NAME TEXT print $cgi -> mark ('CONTACT', $cgi -> h2 ('How to contact us')); Generates target NAME for hyperlinks. row [ITEM ...] print $cgi -> row ('Date', 18, 1, 1966); Produces HTML code for a table row with ITEM arguments as cell contents. recall TEXT [NAME [VALUE]] ... foreach my $num (sort (keys %artmap)) { print $cgi -> recall ($artmap{$num}, artnum => $num); print $cgi -> br; } Produces a link to the script itself labeled with TEXT. The NAME/VALUE pairs will be passed as parameters. AUTHOR
Stefan Hornburg, racke@linuxia.de SEE ALSO
perl(1), URI::Escape(3), CGI(3). perl v5.8.4 2004-07-11 Extratags(3pm)
All times are GMT -4. The time now is 12:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy