How to import shell functions from one file into another? -
i have shell script: #!/bin/bash export ld=$(lsb_release -sd | sed 's/"//g') export arch=$(uname -m) export ver=$(lsb_release -sr) # load test function /bin/bash -c "lib/test.sh" echo $ver distros=('arch' 'centos' 'debian' 'fedora' 'gentoo') in "${distros[@]}" i=$(echo $i | tr '[:upper:]' '[:lower:]') # convert distro string lowercase if [[ $ld == "$i"* ]]; ./$arch/${i}.sh fi done as can see should run shell script, depending on architecture , os run on. should first run script lib/test.sh before runs architecture , os-specific script. lib/test.sh : #!/bin/bash function comex { $1 >/dev/null 2>&1 } and when run on x86_64 arch linux x86_64/arch.sh script: #!/bin/bash if comex atom; printf "atom installed!" elif comex git; printf "git installed!" fi it returned output: rolling ./x86_64/arch.sh: line 3: comex: command not...