samplelkp.blogg.se

Sh tech all to a text file
Sh tech all to a text file











By the time bash is running, it's too late it gets the arguments as they were interpreted by CMD or whatever your Windows command interpreter is. So it won't work from the Windows command prompt, even if the program you are running happens to be written in bash. The 2> redirection syntax only works if the command line containing that syntax is interpreted by bash. sh files are something from the unix world and that the problem might lie there but I don't know why I can not redirect the output briefly shown in the bash-console to a text file. So I guess the redirecting of the output works fine until I use test.sh. I get 'Der Befehl "echdo" ist entweder falsch geschrieben oder konnte nicht gefunden werden.' in the log.txt file. If I type the following directly in the terminal, the output is written in the log.txt: If I only have echo hi therein the test.sh file I get bash: echo: command not found in the bash-window. I get the output in the briefly open bash-window:īash: #!/bin/bash: No such file or directory If I try the same with a test.sh file and the content: Every google search brings me to websites talking about redirecting the output and that Stream2 ist STDERR and therefore I should use test.sh 2> log.txt or something smiliar that takes care of the STDERR stream. I want to save that output because the bash-window just opens for a split second.

sh tech all to a text file

"blablubb").Īfter that I open the terminal (cmd.exe), switch to the directory and type test.sh 2> log.txt.Īnother window opens with "/usr/bin/bash -login -i \test.sh" in the title bar, shows me "bash: blablubb: command not found" and then closes immediately.

sh tech all to a text file

So I created the test.sh file and wrote an unkown command in it (i.e.

sh tech all to a text file

I am running Windows 10 and am trying to save the error output of a test.sh file to a text file.













Sh tech all to a text file