Ich versuche Shell-Skript von Power Shell in Windows-Maschine ausführen. So begann das Schreiben der Shell-Skript und aufgerufen in der Linux-Box mit dem Befehl unten:Shell-Skript von Power Shell in Windows-Maschine ausführen
PS>.\pscp.exe .\abc.sh [email protected]:/root` and gave the permissions through power shell by using below command
PS>.\plink.exe -pw "L***e" [email protected] -P 22 "chmod +x abc.sh"` after that verified that shell script copied or not
PS>.\plink.exe -pw "L***e" [email protected] -P 22 "ls"
So wurde es kopiert. Danach, wenn ich durch die Verwendung unter Befehl bin Ausführung:
PS>.\plink.exe -pw "L***e" [email protected] -P 22 "bash ./abc.sh"`
Es ist nicht im Sinne immer Fehlern arbeitet wie:
./abc.sh: line 4: $'\r': command not found ./abc.sh:
line 5: syntaxerror near unexpected token `$'\r'' '/abc.sh:
line 5: `function abc()
PS>.\plink.exe -pw "L***e" [email protected] -P 22 "./abc.sh"
bash: ./abc.sh: /bin/bash^M: bad interpreter: No such file or directory
Sollte wertvollen Anregungen spürbar und Dank im Voraus ......