#!/bin/bash uuid=$(uuidgen) echo "Generated UUID: $uuid"
#!/bin/bash uuid=$(openssl rand -hex 16) echo "Generated UUID: $uuid"
#!/bin/bash uuid=$(cat /proc/sys/kernel/random/uuid) echo "Generated UUID: $uuid"
#!/bin/bash uuid=$(uuid) echo "Generated UUID: $uuid"
In this tutorial, we explored four different ways to generate UUIDs in shell scripts. We learned how to use the uuidgen command, the openssl command, the cat command with /proc/sys/kernel/random/uuid, and the uuid command-line tool. Each method provides a simple way to generate unique identifiers suitable for various use cases.