I created a new directory using mkdir in my program and I am trying to create a text file in it, usually if I was in the terminal I would do something like:
cd whatever/directory/I want
touch filename.txt OR cat > filename.txt
How can I implement this in exec or some of its variants as I could only make it execute the second part without the cd part which means my file will be created but not in the directory I want.