Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash if variable is not empty

VAR=`echo Hello world`
if [[ -n "$VAR" ]] ; then echo "Variable is set"  ; fi
if [[ -z "$VAR" ]] ; then echo "Variable is null" ; fi
Comment

check if a variable is null in bash

if [[ -n "$list_Data" ]]
then
    echo "not Empty"
else
    echo "empty"
fi
Comment

PREVIOUS NEXT
Code Example
Shell :: update submodule git 
Shell :: change remote origin to fork 
Shell :: linux bash how to clear log files debian ubuntu centos 
Shell :: powershell on linux 
Shell :: while loop bash 
Shell :: delete a local and remote git branch 
Shell :: yarn add @materialui 
Shell :: bash scripts options 
Shell :: bash copy file to directory 
Shell :: gitignore tracked files 
Shell :: bash store file in array 
Shell :: concatenate strings batch 
Shell :: set zsh as default linux 
Shell :: git change commit id email 
Shell :: watch distro linux 
Shell :: ubuntu cant find packages terminal 
Shell :: grep show lines above and below 
Shell :: ords version view 
Shell :: taskbar directory windows 
Shell :: linux ssh with password in one line 
Shell :: brew mongodb: unknown version :mountain_lion 
Shell :: date fns install 
Shell :: spyder 4.2.5 requires pyqt5<5.13, but you have pyqt5 5.15.4 which is incompatible. 
Shell :: install android studio from ubuntu terminal 
Shell :: rm -rf 
Shell :: android create keystore command line 
Shell :: bash copy contents of file to clipboard 
Shell :: run laravel project from github 
Shell :: get size of image linux 
Shell :: powershell list special built in accounts 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =