For example, if I assign


...the following fails (with date: invalid date '2'):

date >> logfile $TWO>&1

Of course, I can always do

eval "date >> logfile $TWO>&1"

Is this the only way to run expressions that include stream redirections where at least some of the file descriptors appear as variables?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.