[Solved] how to display 3 random pictures out of 8 using bash


I am not going to do your homework for you!
However I can give you some insight:

  • store your 8 file names in an array
  • call $RANDOM % 8 3 times and store the value in 3 index variables
  • use the 3 index variables to extract your 3 files
  • use sha256sum, sha512sum or md5sum to compute the signature of your images and store the result in 3 variables
  • compare the values of the 3 variables if they are the same echo "yeeey" else echo "neeey"
  • if on top of that you want to display the picture as written in your post you could call eog or other similar tool with the finename as parameter and of course in background, with a & at the end of the command call.

Good luck with your assignment and let me know if you need help!

1

solved how to display 3 random pictures out of 8 using bash