yppirt090497
asked on
redirecting stdout from within ksh script
Is it possible to execute an intruction at the top of a ksh script to redirect any further standard output to a file? I want to avoid having to create another script which calls the main script with redirection.
Can you give a example of what you are looking (a copy of you script)?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Tested and it works nicely.
I was also sent another solution which uses 'exec'.
exec 1>foo
exec 2>foo
echo "test redirect"
I was also sent another solution which uses 'exec'.
exec 1>foo
exec 2>foo
echo "test redirect"