π Example-1
1 2
| print("This is demo 1.")
|
How write and run shell script
- Write a shell script similar to the example below and save it as
run.sh
1 2
| # run.sh python demo-1.py
|
- Open Git Bash in the Terminal
bash run.sh
π Example-2
1 2 3 4 5 6 7 8
| string = input("type something.....")
print(f"""
String = {string}
""")
|
1 2 3
| # run.sh echo "hello world - 1" | python demo-2.py echo "hello cat - 2" | python demo-2.py
|
π‘Error run.sh: line 1: python: command not found
- Configure the path to your Python executable
- To find the path of your Python exe, you can use the command
where python
1 2 3
| # run.sh PYTHON=/mnt/c/Miniconda3/python.exe "$PYTHON" demo-1.py
|