mirror of
https://github.com/ellysh/bash-programming-from-scratch.git
synced 2026-01-26 07:43:42 +00:00
18 lines
238 B
Bash
18 lines
238 B
Bash
#!/bin/bash
|
|
|
|
option="$1"
|
|
|
|
declare -A files=(
|
|
["h"]="~/.bashrc-home"
|
|
["w"]="~/.bashrc-work")
|
|
|
|
if [[ -z "$option" || ! -v files["$option"] ]]
|
|
then
|
|
echo "Invalid option"
|
|
exit 1
|
|
fi
|
|
|
|
rm ~/.bashrc
|
|
|
|
ln -s "${files["$option"]}" ~/.bashrc
|