[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

bash syntax question

I recently came across the following example for switching time zones:

$ date
Fr 6. Jun 12:49:30 CEST 2008
$ TZ=UTC date
Fr 6. Jun 10:49:35 UTC 2008

Could someone please explain to me the general shell syntax involved here? I did not know that I could put an assignment and a command on one line. My dull approach would have been

$ echo $TZ

$ export TZ
$ date
Fr 6. Jun 10:54:29 UTC 2008
$ unset TZ
$ date
Fr 6. Jun 12:54:39 CEST 2008

Thanks in advance,

Reply to: