Timeline for How to generate a random string?
Current License: CC BY-SA 4.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| S Apr 4 at 15:21 | history | suggested | Alex Ball | CC BY-SA 4.0 |
shuf always outputs to STDOUT; --echo changes the mode of input
|
| Apr 4 at 8:36 | review | Suggested edits | |||
| S Apr 4 at 15:21 | |||||
| Apr 9, 2024 at 16:03 | comment | added | jwhitlock |
Additional characters can be added by separating with spaces. The AWS IAM version requires some escapes: shuf -er -n20 {A..Z} {a..z} {0..9} \! @ \# \$ % ^ \& \* \( \) _ + - = [ ] { } \| \' | tr -d '\n' && printf "\n"
|
|
| Nov 8, 2023 at 17:18 | comment | added | Iain Samuel McLean Elder |
Can you make it guarantee at least one selection from each character class? I need to implement the AWS IAM user default password policy. Minimum of three of the following mix of character types: uppercase, lowercase, numbers, and non-alphanumeric character (! @ # $ % ^ & * ( ) _ + - = [ ] { } | ').
|
|
| Oct 30, 2022 at 9:55 | comment | added | mirekphd |
&& printf "\n"
|
|
| S Mar 18, 2022 at 9:20 | history | edited | Stephen Kitt | CC BY-SA 4.0 |
Instead of deleting the null characters, avoid -z and delete newlines.
|
| S Mar 18, 2022 at 9:20 | history | suggested | mountain | CC BY-SA 4.0 |
the -z flag only replaces '\n' withand '\0' char at the end of each char. making the string multi byte
|
| Mar 17, 2022 at 12:14 | review | Suggested edits | |||
| S Mar 18, 2022 at 9:20 | |||||
| Sep 1, 2020 at 13:29 | comment | added | baldrs |
To run this in fish shell, use bash -c 'shuf -zer -n20 {A..Z} {a..z} {0..9}'
|
|
| Apr 14, 2020 at 11:54 | review | Suggested edits | |||
| Apr 14, 2020 at 19:39 | |||||
| Oct 29, 2016 at 22:23 | review | Late answers | |||
| Oct 29, 2016 at 22:25 | |||||
| Oct 29, 2016 at 22:10 | review | First posts | |||
| Oct 29, 2016 at 22:17 | |||||
| Oct 29, 2016 at 22:06 | history | answered | entwicklerseite | CC BY-SA 3.0 |