#!/bin/sh node=$(uname -n) node_files=($(ls $PWD/$node)) common_files=($(ls $PWD/common)) dest="$HOME/.local/bin" # Ensure destination exists if [ ! -d "$dest" ]; then mkdir -p "$dest" fi for file in "${node_files[@]}"; do ln -sf "$PWD/bin/$file" "$dest" done for file in "${common_files[@]}"; do ln -sf "$PWD/bin/$file" "$dest" done