particuleio / teks

Full feature EKS cluster with Terragrunt/Terraform
https://particuleio.github.io/teks/
Apache License 2.0
334 stars 80 forks source link

correct the command in installation doc #276

Closed neeltom92 closed 2 months ago

neeltom92 commented 2 months ago

Issue: Error in Command Using cut for Extracting Tool Names from .tool-versions

Description:

An error occurs when using the cut command to extract tool names from the .tool-versions file. The command is intended to automate adding ASDF plugins based on the tools listed in the .tool-versions file.

Original Command:

cut -d " " .tool-versions -f1

Error Message:

usage: cut -b list [-n] [file ...]
       cut -c list [file ...]
       cut -f list [-s] [-w | -d delim] [file ...]
image

Cause:

The error occurs because the cut command arguments are incorrectly ordered. Specifically, the filename .tool-versions is placed before the -f1 option, leading cut to misinterpret the arguments and throw a usage error.

Corrected Command:

cut -d " " -f1 .tool-versions
image

Explanation:

This corrects the command, enabling it to properly extract the first field (tool names) from the .tool-versions file.

Example Usage with ASDF:

To automate adding ASDF plugins for each tool listed in .tool-versions:

for p in $(cut -d " " -f1 .tool-versions); do asdf plugin-add $p; done