VehiclesFashionRecipesBlogsHuntTravelsSportFunHandmadeITEducation
Mini-Games
x

x
zakruti.com » IT - Software » IT, programs, coding
Turn Bash Into A Game Of Chance With $RANDOM DistroTube

Turn Bash Into A Game Of Chance With $RANDOM DistroTube

FBTwitterReddit

video description

Rating: 4.0; Vote: 1
Turn Bash Into A Game Of Chance With $RANDOM DistroTube This short video demonstrates how you can make the terminal a bit more exciting by introducing a bit of randomness into your commands. THE COMMANDS: [ $[$RANDOM % 10] = 0 ] && command1 command2 [ $[$RANDOM % 10] = 0 ] && timeout 5 command1 command2 alias clear='[ $[$RANDOM % 1] = 0 ] && cd /home/dt/vt100 && ./slowcat.pl $(/bin/ls - grep .vt - shuf -n 1) clear' - https://www.tldp.org/LDP/abs/html/randomvar.html - https://en.wikipedia.org/wiki/VT100 - http://artscene.textfiles.com/vt100/ - VT animations - http://artscene.textfiles.com/viewers/linux/slowcat.pl - Slowcat perl script
Date: 2022-03-30

Comments and reviews: 10


I still don't understand how I am supposed to play the VT animations.
Just creating -slowcat.pl- and pasting there the script gives an error after running -./slowcat.pl bambi.vt- it says -permission denied-. After adding sudo it just says: -command not found-.
I understand that it's an old video but maybe there is someone who could help?

reply

I have two arrays containing a couple kaomoji faces (one array is happy and surprised while the the other is sad and disappointed) on my $PS1 to indicate when something ends as zero or non-zero - and after $PS1 gets the exit code, it selects a face from the appropriate array using $RANDOM. Adds some personality to my bash. c:
reply

Don't get offended DT, but this just shows what happens when you decide to go minimalistic, you want some minimalistic bloat. I am the bloated guy who enjoys KDE Plasma in all its glory. I can spend weeks going through all the settings. That's my kind of fun when I am bored. I love your site, keep it up!
reply

0:23 I keep getting this message: [: ']' expected
5:10 NNNOOOO!!!! I have been spared this video for so long! Why the heck did you have to do that??? :'(
Might there be a way to deliberately slow down the terminal output? I'm WarGames and there are probably other examples of this.

reply

There is also telnet version of -Star wars new hope- to be played in the terminal
This command worked on ubuntu for me:
telnet towel.blinkenlights.nl
But now I am not able to find working telnet client even in AUR

reply

You know what, this year I-ve found a lot of fun silly stuff that can happen a shell, na d it-s great because I use an old far less powerful PC as my Arco Linux full time workstation. Of cause Linux runs so fast on that thing too.
reply

Hey DT
You can try using -\ls- for -/bin/ls- (assuming -/bin/ls- is priority in $PATH)
Not sure if this works on fish though. Maybe you can let me know.

reply

Hey DT, please be aware, informed and most of all stay safe. I'm over here near Pensacola Fla. on the east side of this storm. Button down the hatches my Linux friend!
reply

Can you do this with more than option? For example instead of a 1 in 6 chance you will get the random command, can you make it a 1 in 6 chance that it'll clear?
reply

If your ls is aliased you can just use \ls to use the normal ls. Note that this will still work even if ls is not aliased so it is safe to use
reply
Add a review, comment






Other channel videos