58

Is Bash shell scripting case sensitive?

Is variable date the same as DATE?

6
  • 5
    You could just try setting both and see if they remain distinct. Commented Mar 22, 2013 at 13:47
  • 7
    date, Date, dAte, DAte, daTe, DaTe, dATe, DATe, datE, DatE, dAtE, DAtE, daTE, DaTE, dATE, DATE are all different variables ;) Commented Mar 22, 2013 at 14:21
  • 5
    Why did this get down-voted? The question is a bit ambiguous indeed but it's acceptable for someone new to BASH. Commented Aug 28, 2014 at 10:03
  • 1
    It's not a real question because simply trying it would have been quicker than phrasing it ... @Pithikos Commented Nov 16, 2017 at 16:22
  • 6
    The fact that someone can verify this immediately having bash doesn't mean that this question is not valid. Commented Nov 16, 2017 at 16:34

1 Answer 1

76

Yes, it is case sensitive, just like the rest of UNIX. $date and $DATE are two different variables. makefile and Makefile are two different files. -h and -H are two distinct flags (usually).

Sign up to request clarification or add additional context in comments.

2 Comments

Rather, -h and -H are always distinct, but may be interpreted identically by the program that accepts them.
macOS's (and maybe Windows's?) filesystem is case-insensitive so makefile and Makefile are the same file there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.