0

Hi I am automating my file transfering to a distant server but for now it is on my pc for while the script is not complete but I am stuck because the cygwin terminal does note recognise commands after I test my script. I have to restart the terminal for it to work properlly but my script never work because of that.

I configured ssh login on the server for autentification for the transfer command

I tried to use the command by hand and it works and even if I only put the command alone in the script it works but when I put back the lines the terminal no longer recognise any commands.

Sometimes the command is not found or bash interprets a command as a path so bash return the error path not found and it is not limited to scp command even cp, mv, rm, mkdir, rmdircat, ls as for other commands I dont know I didnt want to try every commands but pwd and cd commands works

enter image description here

Grez
  • 59
  • 8
  • 1
    Your script is corrupting your PATH. – Charles Duffy Dec 12 '21 at 01:52
  • 1
    This is part of why you're supposed to use only lower case variable names for your own variables, to not override ones with meaning to the system (like PATH) by mistake. – Charles Duffy Dec 12 '21 at 01:53
  • 1
    Also, why are you sourcing your script instead of running it as an executable? If you ran it normally it wouldn't be able to change your shell's variables, working directory, or other process-local state. – Charles Duffy Dec 12 '21 at 01:54
  • 2
    Also, don't post code as images; enough information to answer the question should **always** be included as text. – Charles Duffy Dec 12 '21 at 01:54
  • On that last point, see [Why not upload images of code/errors when asking a question?](https://meta.stackoverflow.com/a/285557/14122) on [meta]. – Charles Duffy Dec 12 '21 at 02:00

0 Answers0