Replies: 2 comments
-
Try "{{ uuid | trunc 6 }}" perhaps ? but perhaps its better to not depend on task, and rather:
which is a method that lets you do anything (there are lots of ways to get a random string ....) depending on what you need. |
Beta Was this translation helpful? Give feedback.
0 replies
-
i agree; there are multiple ways to formulate a random number; but to borrow from python: `There should be one-- and preferably only one --obvious way to do it.` pep-20
…________________________________
From: Timothy Rule ***@***.***>
Sent: 30 July 2025 21:42
To: go-task/task ***@***.***>
Cc: Nick Ves ***@***.***>; Author ***@***.***>
Subject: Re: [go-task/task] Random string function (Discussion #2342)
Try "{{ uuid | trunc 6 }}" perhaps ?
but perhaps its better to not depend on task, and rather:
vars:
RANDOM_STRING:
sh: tr -dc A-Za-z0-9 </dev/urandom | head -c 6; echo
which is a method that lets you do anything (there are lots of ways to get a random string ....) depending on what you need.
—
Reply to this email directly, view it on GitHub<#2342 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABS74EVX6UYUJFJJRBJJWJL3LEU35AVCNFSM6AAAAACCWOTKGOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGOJTHA2TSOI>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hi we have a random string function please? currently i am doing this
it would be nice to have something more clear like:
Beta Was this translation helpful? Give feedback.
All reactions