Jan-16-2020, 02:13 PM
Hi
thank you for the below, yes i want to run for example start.sh and it as above runs it for 30 seconds then pauases for 30 seconds and so on.
then stop.sh to stop it
Is this possible
thanks again
Paul
thank you for the below, yes i want to run for example start.sh and it as above runs it for 30 seconds then pauases for 30 seconds and so on.
then stop.sh to stop it
Is this possible
thanks again
Paul
(Jan-16-2020, 01:18 PM)DeaD_EyE Wrote:I guess you made the file executable and just run it.
Error:./s.sh: line 4: import: command not found
Currently you try to run your code as Shell Script with the Bash.
The file extension is also misleading, because it's a Python Script and not a Shell Script.
Linux looks for the shebang, which starts with#!
.
Everything after this two chars is a path to an interpreter.
We know it as:
#!/bin/bash #!/bin/sh #!/usr/python #!/usr/python3 #!/usr/env python3If the shebang is missing, he falls back to your default shell (Bash) and runs the script inside the default Shell.
Add the right shebang or call the file directly with python3.
python3 you_script.pyDo you want to start/stop the script with two different commands likestart
andstop
?