Scp notes

From raju


Situation: When copying files from a windows machine to a linux machine by running scp on the windows machine, I get the error

    stty: standard input: Invalid argument

System Info: The scp in windows machine is from "git bash". The default shell on the Linux machine is csh.

Solution: The problem here is that the Linux machine's ~/.cshrc spews out some text on stdout whenever it is sourced. If this happens, scp borks. The trick here is to modify ~/.cshrc on the Linux machine so it does not throw any output on the screen when run non-interactively. To achieve this add these lines to ~/.cshrc

    # This is necessary if you want to copy files from another machine to this
    # machine by running scp on the other machine.
    if (! $?loginsh) then
      # echo "not a login shell"


  1. shows how to do this if the default shell is bash.
  2. tells how to detect if a csh shell is interactive or not.