Skip to content

Instantly share code, notes, and snippets.

View sudoforge's full-sized avatar

sudoforge

View GitHub Profile
@sudoforge
sudoforge / 01-positional-arguments-to-array.bash
Last active June 30, 2024 17:42
A few different ways to grab input in a bash script.
#!/usr/bin/env bash
# assign "$1" and "$2", which are the first and second positional arguments,
# as items 0 and 1 in the `arr` array.
arr=("$1" "$2")
printf "\n\nthe final values are: %s\n" "${arr[*]}"
@sudoforge
sudoforge / README.md
Last active July 13, 2024 04:20
Managing multiple Git identities

Managing multiple Git identities

This gist exists to display how I manage my Git configuration for different identities (e.g. personal and work identities) using the default configuration chain in Git.

My global git configuration is stored [in my dotiles repository][dotfiles], which is public, but includes no work-related git configuration. Instead, that lives in and is managed by other files on my system, which are not synced to that public dotfiles repository. With just a few small configuration changes,