36

Is bash shell scripting case sensitive?

Is variable date the same as DATE?

Vadim Kotov
  • 7,103
  • 8
  • 44
  • 57
Mario
  • 1,873
  • 5
  • 17
  • 21
  • 5
    You could just try setting both and see if they remain distinct. – chepner Mar 22 '13 at 13:47
  • 6
    date, Date, dAte, DAte, daTe, DaTe, dATe, DATe, datE, DatE, dAtE, DAtE, daTE, DaTE, dATE, DATE are all different variables ;) – anishsane Mar 22 '13 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. – Pithikos Aug 28 '14 at 10:03
  • It's not a real question because simply trying it would have been quicker than phrasing it ... @Pithikos – tink Nov 16 '17 at 16:22
  • 3
    The fact that someone can verify this immediately having bash doesn't mean that this question is not valid. – kubal5003 Nov 16 '17 at 16:34

1 Answers1

56

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).

John Kugelman
  • 307,513
  • 65
  • 473
  • 519
  • 13
    Rather, `-h` and `-H` are always distinct, but may be interpreted identically by the program that accepts them. – chepner Mar 22 '13 at 13:46