[{"data":1,"prerenderedAt":108},["ShallowReactive",2],{"post:check-for-empty-string":3},{"id":4,"title":5,"body":6,"date":97,"description":12,"draft":98,"extension":99,"meta":100,"navigation":101,"path":102,"seo":103,"stem":104,"tags":105,"__hash__":107},"posts\u002Fposts\u002Fcheck-for-empty-string.md","TIL: Check for Empty String in Bash",{"type":7,"value":8,"toc":94},"minimark",[9,13,40,43,53,75,82,90],[10,11,12],"p",{},"So, I'm grabbing argument number three.",[14,15,20],"pre",{"className":16,"code":17,"language":18,"meta":19,"style":19},"language-bash shiki shiki-themes github-light github-dark","curl_data=$3\n","bash","",[21,22,23],"code",{"__ignoreMap":19},[24,25,28,32,36],"span",{"class":26,"line":27},"line",1,[24,29,31],{"class":30},"sVt8B","curl_data",[24,33,35],{"class":34},"szBVR","=",[24,37,39],{"class":38},"s4XuR","$3\n",[10,41,42],{},"How do I know if the user provided this at all?",[10,44,45,52],{},[46,47,51],"a",{"href":48,"rel":49},"https:\u002F\u002Fserverfault.com\u002Fquestions\u002F7503\u002Fhow-to-determine-if-a-bash-variable-is-empty",[50],"nofollow","Stack Overflow wins again",":",[14,54,56],{"className":16,"code":55,"language":18,"meta":19,"style":19},"if [[ -z $curl_data ]]; then\n",[21,57,58],{"__ignoreMap":19},[24,59,60,63,66,69,72],{"class":26,"line":27},[24,61,62],{"class":34},"if",[24,64,65],{"class":30}," [[ ",[24,67,68],{"class":34},"-z",[24,70,71],{"class":30}," $curl_data ]]; ",[24,73,74],{"class":34},"then\n",[10,76,77,78,81],{},"This is in the ",[21,79,80],{},"man"," page for Bash, by the way.",[14,83,88],{"className":84,"code":86,"language":87},[85],"language-text","-z string\n      True if the length of string is zero.\n","text",[21,89,86],{"__ignoreMap":19},[91,92,93],"style",{},"html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":19,"searchDepth":95,"depth":95,"links":96},2,[],"2018-05-18T23:26:57-04:00",false,"md",{},true,"\u002Fposts\u002Fcheck-for-empty-string",{"title":5,"description":12},"posts\u002Fcheck-for-empty-string",[18,106],"til","7KdapTIiCtZbjcld7vR2kbZp3vQPjST-xH0qCJC8t0w",1790471528193]