NBash
38 строк · 612.0 Байт
1#!/bin/bash
2
3RAND_NUMBER=$((1 + RANDOM % 100))
4readonly RAND_NUMBER
5
6step=0
7array=()
8
9while [ $step -le $RAND_NUMBER ]
10do
11array+=("$step")
12step=$((step + 1))
13done
14
15echo "${array[@]}"
16
17echo "-----------------------------------------"
18
19unset array
20
21for ((step = 0; step <= $RAND_NUMBER; step++))
22{
23array+=("$step")
24}
25
26echo "${array[@]}"
27
28# Генератор паролей
29echo "-----------------------------------------"
30password=""
31
32while [[ ${#password} -ne 30 ]]
33do
34rand_char=$(shuf -e -n1 {A..Z} {a..z} {0..9})
35password+="$rand_char"
36done
37
38echo "Ваш новый пароль: $password"