[LEFT]I've got a file (numbers.txt) filled with numbers and I want to replace each one of those numbers with a new random number between 0 and 9. This is my script so far:
#!/bin/bash
rand=$(($RANDOM % 9))
sed -i s/[0-9]/$rand/g numbers.txt
The problem that I have is that it replaces each number with just one random number (for example 82197 would just become 33333). Is there any way that I can get the script to replace each number with a random number?
[/LEFT]