redirecting to and from one file