Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

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
 
PREVIOUS NEXT
Tagged: #bash #open #programm #exists
ADD COMMENT
Topic
Name
1+3 =