Grouping commands in bash
Hi ALL,
I've question about grouping of commands in the bash. For the sake of simplicity I'll show a bit artificial example but it explain the issue. For example I can run following commands: Code:
$ date; date Code:
$ TZ='Asia/Kolkata' date; date I know that bash allows grouping of executed commands like below: Code:
$ (date; date) Code:
$ TZ='Asia/Kolkata' (date; date) Thanks. P.S. I know that I can export variable TZ to environment and then execute commands from the example, but I want to find out how to do that with help of a single command line :cool: |
This ?
Code:
(export TZ='Asia/Kolkata' && date && date) |
Quote:
Thank you very much. Your answer give me right direction to write what I want: Code:
$ (TZ='Asia/Kolkata'; date; date) |
All times are GMT -5. The time now is 02:02 AM. |