Horje
bash open programm when exists Code Example
bash open programm when exists
#! /bin/bash
array=("Google Chrome")
value=$@

if [[ " ${array[*]} " =~ " ${value} " ]]; then
    # open programm when in array / available
    open -a "${array[*]}"
fi

if [[ ! " ${array[*]} " =~ " ${value} " ]]; then
    # Can't find program
    echo "Programm not avalailable"
fi




Shell

Related
update pnpm Code Example update pnpm Code Example
delete branch github Code Example delete branch github Code Example
change partition in cmd Code Example change partition in cmd Code Example
"capacitor" Permissions Switch must be exhaustive Code Example "capacitor" Permissions Switch must be exhaustive Code Example
E: Package 'ruby' has no installation candidate debian Code Example E: Package 'ruby' has no installation candidate debian Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12