[SOLVED] Need Code to Randomly select Star Trek Series and Episode Number.
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
View Poll Results: What is your favorite Star Trek series?
Need Code to Randomly select Star Trek Series and Episode Number.
Hi.
Can someone make a command/script that can randomly generate one of these Star Trek series acronyms (tos, tng, ds9, voy, ent) and an episode from a corresponding number range?
Example output: voy25
That being the 25th episode overall in the Voyager series.
So if tos is selected then output a number from 1-79 (there were 79 episodes in The Original Series)
For tng 1-178. (The Next Generation had the most episodes at 178)
For ds9 1-176.
For voy 1-172.
For ent 1-98.
Thanks.
Last edited by linustalman; 07-30-2017 at 04:56 AM.
I'm surprised someone who has been here since 2010 and has over 1600 posts never learned the basics of shell scripting. This is a completely trivial problem that took me less than 30 seconds (and that was just the time to type it). Where are you stuck?
hint: for loop using brace expansion piped into 'shuf -n1'
Here we have a poll about Star Trek and no one said one thing about Star Trek in 12 posts. Amazing.
I absolutely LOVED The Next Generation when it played originally, but every time I've watched a rerun I've been disgusted by the political correctness. Maybe I was just naive the first time around.
The TOS is the only one to watch. It always had two parts to the shows. One was tech and other was some sort of literary conflict. They didn't go overboard on PC. It was the only tech show at the time.
TOS of course. TNG very, very close second. But I also think they did a pretty good job on DS9, Voyager and Enterprise. I like the whole of it. When you add all of these together and see the larger picture of the Federation, the universe its in, etc. its great.
Individually though TOS is the one. It all started there.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.