**** BEGIN LOGGING AT Wed Jul 10 03:01:22 2019 Jul 10 12:15:10 can random be used in a loop on the shell without having the same number come up Jul 10 12:17:11 ? Jul 10 12:17:25 try: echo $RANDOM Jul 10 12:17:32 works in bash Jul 10 12:17:34 to avoid xy I need to pull a random list of say 50 integers from a pool of 01-99 . I beleive RANDOM will repeat them if in a loop Jul 10 12:17:48 it returns 0-32767 i think Jul 10 12:18:04 up to you to scale it to range you need Jul 10 12:18:07 i want no duplicates Jul 10 12:18:15 thats not random then Jul 10 12:18:47 what you need is to create an array with 99 elements, then shuffle it Jul 10 12:18:57 well I suppose so but that's what i am looking for Jul 10 12:19:12 i see is array the best way you think? Jul 10 12:19:39 otherwise you have to keep different array with 'used' numbers anyway Jul 10 12:19:59 and having to scan through it on every new return Jul 10 12:20:38 I suppose so. I didn't think of it like that. i was hoping for a shell function already there :) Jul 10 12:21:13 i havent seen such functionality in bash Jul 10 12:21:44 anyway, your problem is 'shuffle deck of cards then deal them' Jul 10 12:21:54 taught in schools often Jul 10 12:22:06 so there should be lots of examples for different languages Jul 10 12:22:10 np array it is then. school? Jul 10 12:22:26 ya, it101 Jul 10 12:23:10 school is long behind me we where lucky to have working ones in my era Jul 10 12:23:39 but as i've said, google: deal shuffled deck of cards in bash Jul 10 12:26:48 or a more interesting way of looking at it: find an information densitity preserving encryption, and encrypt all possible inputs in a predictable sequence. Jul 10 12:27:08 or basically: shuffle in bash Jul 10 12:27:13 basically, encrypt(0), encrypt(1), encrypt(2), .. encrypt(n) Jul 10 12:27:31 yep i am waiting for something to render so can't open a browser at the moment, hence I thought I'd ask the question having used random before. Jul 10 12:27:53 swb: but it's better to use any scripting lang, perl/php/python Jul 10 12:28:03 whichever you are best in Jul 10 12:28:25 at some point you will have to switch to it when adding functionality Jul 10 12:28:44 anyway, if you want a sequence of numbers in a random order: seq 99 | sort -R | head -50 Jul 10 12:29:23 wow Jul 10 12:29:24 only ever used bash for most things but i can have a look in python if necessary. Jul 10 12:29:30 i forgot sort has shuffle Jul 10 12:29:33 (`seq 99` is a bit weird; I suspect what you really want is either `seq 0 99` or `seq 100`, which both emit 100 numbers (`seq 99` emits 99 numbers)) Jul 10 12:30:06 oh useful ty :) Jul 10 12:30:46 seq -f '%02.0f' 1 99|sort -R Jul 10 12:30:47 done Jul 10 12:31:55 if you want only 50 of them, add |head -50 Jul 10 12:33:05 oh i see you have used the format flag to have 2sf nice Jul 10 15:20:10 Mangy_Dog: pink screen on hdmi means hdmi pixel format failed Jul 10 15:20:14 erm, wrong chan **** ENDING LOGGING AT Thu Jul 11 03:01:20 2019