Bash Determine whether a Variable Contains Spaces

From NovaOrdis Knowledge Base
Revision as of 19:53, 20 September 2019 by Ovidiu (talk | contribs) (Created page with "=Internal= * bash =Method 1= <syntaxhighlight lang='bash'> if [[ ${a} = ${a// /} ]]; then echo "spaces NOT found" else echo "spaces found...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Internal

Method 1

if [[ ${a} = ${a// /} ]]; then
    echo "spaces NOT found"
else
    echo "spaces found"
fi