Search code examples
unixinputoutputtcsh

Tcsh script getting input from user till ctrl-d and output to a file


I have tried a number of websites for help. This is what I have now. I need to get input in a tcsh script from the user and output to a file till the user clicks ctrl-d

> cat > fileName

result

Ambiguous output redirect.


Solution

  • Only one redirection is required.

     cat > fileName
    

    will receive data from the stdin and write the data onto the file.