I am using Clion and I am unsure how to run a .sh file with my code. It is for an assignment, and I have to run an automatic test to test my code.
This is how it is described to be called: $ ./test_p2.sh 2
I have the shell file in the folder with my code, But I cannot see it in executable or working directory.
Any help is appreciated! Thanks
You can't directly run Linux shell scripts on Windows. You do have a few options, however:
Git Bash
in the context menu)Windows Subsystem for Linux
)For 1 and 2, it'll be on you to make sure any dependencies for the script are available in either Cygwin or mintty.
For 3, after making sure WSL is set up you can run a single command under WSL: wsl script.sh arg1 arg2 argX
.
I would recommend option 3 or 4. 3 may offer the best experience in terms of compatibility and ease of set up (without porting the script) as Cygwin and mintty can be a pain to set up dependencies in. Option 4 would be best though as long as you are well-versed in both PowerShell and shell scripts and can transpose the equivalent calls from one to the other.