Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 425 Bytes

check-for-empty-string.md

File metadata and controls

24 lines (16 loc) · 425 Bytes

Check for Empty String in Bash

So, I'm grabbing argument number three.

curl_data=$3

How do I know if the user provided this at all?

Stack Overflow wins again:

if [[ -z $curl_data ]]; then

This is in the man page for Bash, by the way.

-z string
      True if the length of string is zero.