-
IO Redirect error.
I created a program to count the number of characters in a file, it compiles fine and is a really basic program. When I go to redirect a text file to the program I get an error. chrcnt is the compiled program and words is the text file. I use:
chrcnt < words
and I get the error
chrcnt: program not found
I am using ubuntu, any ideas as to why its not working?
-
-
Yep
Quote:
Originally Posted by
Salem
Try
./chrcnt < words
Yep, that did it. Thank you very much.
-
Quote:
Originally Posted by
dtow1
why its not working?
Because by default, current working directory is not one of the directories where executables are searched for.
Explicitly writing the relative path to the executable (./chrcnt)is just the way you tell the OS to not do any kind of search for it, but just run chrcnt in the current directory. No ambiguity, no search, only results you want.