Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

check if a command exists

# To find out if a given command exists:

if command -v given-command > /dev/null 2>&1; then
  echo given-command is available
else
  echo given-command is not available
fi
Comment

determine if command exists

python --version >nul 2>&1 && ( echo found python ) || ( echo fail )
Comment

PREVIOUS NEXT
Code Example
Shell :: bash script perform root access check 
Shell :: unzip a zip file ubuntu 
Shell :: pip install flask dockerfile 
Shell :: how to install automapper in vs code 
Shell :: manjaro network driver installed but not working 
Shell :: clang format linux 
Shell :: tsc watch not support alias path 
Shell :: powershell add to path 
Shell :: running ethermine on linux 
Shell :: avd manger permission need root 
Shell :: How to "git status" 
Shell :: k8s rollout 
Shell :: dokcer not working 
Shell :: nmap run scripts 
Shell :: change jdk version archlinux 
Shell :: install wsl kali linux large full 
Shell :: install apache di linux 
Shell :: ufw command not found bitnami 
Shell :: linux install slic3r 
Shell :: npm typeahead bootstrap 
Shell :: configure: error: "curses not found" 
Shell :: install Miniconda r 
Shell :: virtualenvwrapper-win cannot workon powershell 
Shell :: shell basename 
Shell :: gufw ubuntu install 
Shell :: download zip file from onedrive using wget 
Shell :: importerror no module named numpy ubuntu 
Shell :: linux simple scan 
Shell :: Why double tapping icon doesnt minimize in ubuntu 
Shell :: docker quickstart terminal windows 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =