![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Random command | melaz | Shell Programming and Scripting | 1 | 07-10-2008 05:24 PM |
| FTP random files | whegra | Shell Programming and Scripting | 3 | 11-21-2007 01:22 PM |
| Random | keyvan | Shell Programming and Scripting | 8 | 05-24-2007 09:11 AM |
| Getting a random file | davidY | Shell Programming and Scripting | 6 | 01-01-2007 01:03 AM |
| random in ksh | pascalbout | AIX | 1 | 01-04-2006 06:53 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
$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? |
| Forum Sponsor | ||
|
|
|
|||
|
Hi Aigles
My problem is my program has to prompt a user to do a guess game. The user has to guess a letter from a word that the program randomly chooses and then set a number of lives.
If the user guesses a letter correctly, the letter is displayed within the correct position in the word. i.e pls enter your guess letter: ----- if the word is hello for example, the user enters e then the output has to look like this pls enter your guess letter:-e--- so each dash has to be replaced by the letter and if any guessed letter is wrong, a message should be displayed saying wrong letter: you have 4 lives left |
|
|||
|
In ksh93 the range for the RANDOM variable is 0 - 2**15 and is generated by means of the rand(3) pseudo-random number generator. As an extra precaution, ksh93 checks to see that it never picks the same number twice in a row.
|
|||
| Google The UNIX and Linux Forums |