-1

I am using the tcsh shell of Cygwin. I installed Cygwin because I have a prof giving a bunch of instructions in Linux/Mac and they are all using csh commands.

When I type this:

cat some_file.txt | some_python_script.py

I get this:

some_python_script.py: Command not found.

Where some_python_script.py is a script that should be run on the stdin. How can I get my Python scripts to work in Cygwin like if I was in a linux/Mac environment?

Thanks!

1 Answers1

0

You are asking it to pipe the content of some_file.txt into some_python_script.py

It is expecting a command there. Generally you would run A python script like this

python some_python_script.py

If you want to pipe the content of some_file.txt into it you would do this

cat some_file.txt | python some_python_script.py
Magnon
  • 26
  • 3
  • Yes, exactly what I am trying to do. I think your answer solved my problem, but I am not sure lol! I added the python command, and I don't get the "command not found" anymore. However, I'll have to keep investigating, because now something runs for a few minutes, but I have no output. I think it should output something to the window, but I am not sure. How do I tell it to output the result in a file. Will > output_file.txt work? – JohnnyBGood Nov 21 '19 at 03:58
  • Yes adding ` > output_file.txt` to the end would output and output (that would normally be displayed in the terminal/console) to `output_file.txt`... but since you are not receiving any on screen output, nothing is likely to go into the file – Magnon Nov 21 '19 at 05:09
  • You might need to check what the python script does / how it works, and see if it's supposed to output something. – Magnon Nov 21 '19 at 05:11
  • Thank you so much, I think everything here makes sense. This is my first post on Stack Overflow and I appreciated the help! – JohnnyBGood Nov 21 '19 at 06:12
  • Please mark the answer as accepted [click on the check mark beside the answer to toggle it from greyed out to filled in] – Magnon Nov 21 '19 at 07:04