You're viewing a comment by Samus_ and its responses.

September 06, 2012, 18:49

hi Peter, great article! I'd like to add something regarding point 12, you can also do it with braces like this:

    $ { command1; command2; } >file

which avoids the subshell (performance) and also allows you to modify vars within the context of the executing script, subshells can't do that.

the subshell is useful precisely when you want to modify the environment but just within that context, you no longer need to restore the original values after you're done.

by the way, I'm preparing a talk for some friends regarding redirections and I'd like to use some material from here, I'll cite you as a source but if you prefer not to be included please let me know.

thank you.

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "apple_329": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.