How ubuntu parameter by uuidgen and remove "-" format

227 views Asked by At

What trouble I have :
image

What I'd like to:
input :

az acr create --resource-group demo --name somefuntion(uuidgen) --sku Basic

expectd :

az acr create --resource-group demo --name "daf506ea86a64c478f5762238a3cc208" --sku Basic

What I've tried :
I know uuidgen can get uuid like

$ uuidgen
daf506ea-86a6-4c47-8f57-62238a3cc208
1

There are 1 answers

0
Bhargavi Annadevara On BEST ANSWER

$() allows for Command Substitution in Bash, i.e., it allows the output of a command to be substituted in place of the command itself.

tr command in Unix can be used to transform the generated UUID to the required format.

Putting these together, you get:

az acr create --resource-group demo--name $(uuidgen | tr -d '-') --sku Basic

which should help you with what you want.