7 ms·
Here is shellcheck compliant solution which uses no external utilities, and is explicit about our intention: # function to imitate "nix --version" since I
by jonahx 6y ago
Here is shellcheck compliant solution which uses no external utilities, and is explicit about our intention:
# function to imitate "nix --version" since I don't have it installed
nixv() {
echo 'nix (Nix) 2.3.4'
}
read -ra arr < <(nixv)
echo "${arr[2]}"