15 lines
389 B
Bash
15 lines
389 B
Bash
|
|
append_to_bashrc() {
|
|
local bashrc="$HOME/.bashrc"
|
|
for file in "$@"; do
|
|
while IFS= read -r line; do
|
|
[[ -z "$line" ]] && continue
|
|
if ! grep -Fxq "$line" "$bashrc"; then
|
|
echo "$line" >> "$bashrc"
|
|
echo "Add: $line to bashrc"
|
|
fi
|
|
done < "$file"
|
|
done
|
|
}
|
|
|
|
append_to_bashrc aliases.sh bashrc.sh |