Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Shell :: inodes full 100% 
Shell :: download video cart driver for manjaro 
Shell :: raspberrypi-ui-mods kept back 
Shell :: docker compose No protocol specified could not connect to display :1 
Shell :: how to follow a file url in vim 
Shell :: create new item from terminal 
Shell :: How to download Net Beans onto linux ubuntu 
Shell :: size of folder linux 
Shell :: arch remove package and dependencies 
Shell :: number fo files prestn in gcs bucket command 
Shell :: debug logstash stdout 
Shell :: how to download openssh with cmd 
Shell :: update homestead after yaml change 
Shell :: bash fully unsquash sqfs file 
Shell :: latex markdown github 
Shell :: wget ignore if exists 
Shell :: notify once a job is completed 
Shell :: import database using cmd ubuntu 
Shell :: neovim source current file 
Shell :: show detail all changes in a git log 
Shell :: network manager restart ubuntu 
Shell :: apagar raspberry desde terminal 
Shell :: how to remove first line from output using awk 
Shell :: install requirements python 
Shell :: bash replace newline with space 
Shell :: kill occupation port windows 
Shell :: zathura show black screen 
Shell :: show rights inside folder debian 
Shell :: make a commit with past date 
Shell :: When should you use a single dash within a Git command, as opposed to a double dash? 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =