Skip to content

Shell internal variable #12

Open
Open
@zmzlois

Description

@zmzlois

Might be some stupid questions but want to see it might help to write other shell script for other potential integrations:

Doppler example

  1. In [src/doppler/install.sh] at line 6
    COMPLETION wasn't an internal variable (as far as my search goes), and other places in setup-doppler.sh and devcontainer-features.json completion were lowercase. it is uppercase here in install.shAnd it is set to true at the beginning? But based on the dagger example these options seems to be related between devcontainer-feature.json and script but they are not case sensitive I guess?

  2. this line checks if the packages listed exists and whether yes or no the output go into /dev/null which is discarded?

  3. In several examples you were all checking file for string name and , like

checkFileForString() {
    # make sure the directory exists
    dirname "$2" | xargs mkdir -p
    if ! grep -sq "$1" "$2"; then
        echo "$1" >> "$2"
    fi
}

but at doppler example this function wasn't being used, is this a function frequently used just as a good utility function for inventory files like ansible/terraform?

  1. why is clean up needed here? here just a good habbit so it doesn't conflict if new key set up exists?

Dagger example

  1. docker-in-docker and docker-outside-of-docker
    I am slightly confused at the difference between docker-in-docker and docker-outside-of-docker, people has told me running docker inside docker is less performant, is it a recommendation or very case specific?

Atuin example

  1. Why Atuin?
    Why is Atuin needed? why not history ? because people can have a reference to look up to without SSH into the terminal?

Best practice

What are the things to consider as good practice when writing shell script for remote host?

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