Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doctl --user-data help syntax wrong #1527

Open
igpit opened this issue May 13, 2024 · 1 comment
Open

doctl --user-data help syntax wrong #1527

igpit opened this issue May 13, 2024 · 1 comment
Labels

Comments

@igpit
Copy link

igpit commented May 13, 2024

Describe the Issue:
wrong help/usage for --user-data

running

doctl compute droplet create --help

shows the usage example:

doctl compute droplet create example-droplet --size s-2vcpu-2gb --image ubuntu-20-04-x64 --region nyc1 --user-data $'#!/bin/bash\n touch /root/example.txt; sudo apt update;sudo snap install doctl'

but at least running this from powershell in windows, this will create a user-data.txt with uninterpreted content, thus it will not run.

Environment:

  • doctl version: latest, 1.106
  • OS: windows powershell 5 or 7

Additional Details:

Needed fix

This is the correct syntax:

  • use "`n" instead of "\n"
  • do not prefix with $

Example:
--user-data "#!/bin/bash`n touch /root/example.txt; sudo apt update;sudo snap install doctl"

@igpit igpit added the bug label May 13, 2024
@danaelhe
Copy link
Member

Hi there,

Thanks for bringing this to our attention, and for providing the correct syntax for Window powershell users. I will create a PR now that will explicitly call this out in our help documentation to avoid confusion in the future.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants