Skip to content

tr: Illegal byte sequence on rds-s3 create stack #4

@justinkraus

Description

@justinkraus

Got "tr: Illegeal byte sequence error" on step 6 in the readme (OSX 12.2.1 Monterey):
aws cloudformation create-stack --stack-name rds-s3 --template-body file://rds_s3.yaml --capabilities CAPABILITY_NAMED_IAM --parameters ParameterKey=BucketName,ParameterValue=$(head /dev/urandom | tr -dc a-z0-9 | head -c10)

Adding LC_ALL=C before tr corrects this:
aws cloudformation create-stack --stack-name rds-s3 --template-body file://rds_s3.yaml --capabilities CAPABILITY_NAMED_IAM --parameters ParameterKey=BucketName,ParameterValue=$(head /dev/urandom | LC_ALL=C tr -dc a-z0-9 | head -c10)

I'm not sure how this impacts the command on other operating systems or I'd propose a PR. See comments on accepted answer here: https://unix.stackexchange.com/questions/45404/why-cant-tr-read-from-dev-urandom-on-osx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions