Can't seem to redirect input in Terminal I'm having issues getting redirection to work in Terminal.  I'm in a C++ class where we have to create an application, then find that application in the Terminal and place a text file in the same folder. That text file then has to be used as the input to the Terminal application we created in C++.  So, after building my application and placing it and a .txt file in a folder, I open the Terminal, navigate to that directory, then use:

program &lt; textfile


or more specifically in my case:

redirect &lt; input.txt


but it doesn't work.  I keep getting: "-bash: redirect: command not found"

I'm using the method our teacher told us to use based on windows command line, but I'm betting its not the same format for Terminal on Mac. I've been googling the issue for about a week and still have not figured it out. Any help would be greatly appreciated. 

EDIT:

Added a photo:



EDIT2:
Far less can go wrong if you pipe the input:

cat words.5.txt | /path/to/redirect


In your case, ./program might be needed depending on where you are compiling things or omitting the path entirely. From your edit this should work too:

./redirect &lt; words.5.txt


That bash error is due to the program not existing in $PATH

echo $PATH