Randomly generate a number between 1 and 60, convert it to octal, and replace the first 5 characters of file.txt with the octal number.
awk -v min=1 -v max=60 'BEGIN{srand(); print int(min+rand()*(max-min+1))}' | xargs printf "%4.4o\n" | xargs -I{} sed -e \$\'s/...../\\{}/g\' file.txt