How do I know if a variable is set in Bash?

For example, how do I check if the user gave the first parameter to a function?

function a {
    # if $1 is set ?
}

3
37

Leave a Reply

Your email address will not be published. Required fields are marked *