Skip to content

Shell internal variable #12

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

Open
zmzlois opened this issue Dec 13, 2023 · 0 comments
Open

Shell internal variable #12

zmzlois opened this issue Dec 13, 2023 · 0 comments

Comments

@zmzlois
Copy link

zmzlois commented Dec 13, 2023

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?

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

No branches or pull requests

1 participant