# Give the script file correct permssions $chmod 744 <name of scipt file e.g script.sh>
$ chmod 744 script.sh
#now the file is ready to run run it with $ ./<name of scirpt file e.g. script.sh>
$ ./script.sh
# if not already ran, run to change permisions executable.
chmod 755 foo.sh
# then to run the sh file
./foo.sh
chmod +x <fileName>
./fileName. # or use ->. bash fileName
include
#!/bin/bash (1st line inside yourfile.sh)
to run
./yourfile.sh
if you do not include that line
bash yourfile.sh
$ chmod 744 script.sh
#now the file is ready to run run it with $ ./<name of scirpt file e.g. script.sh>
$ ./script.sh
sh <name of file>.sh
./yourscript.sh
#Tested on Win11
# Run script from current directory in current Terminal window/tab:
./myfile.bat
# "./" stands for "current directory"
# Run from specific path in a new tab:
wt C:my foldermyfile.bat
# You don't need to wrap the path in quotes
# Run from specific path in current window but split the pane (See 2 terminals at once):
wt split-pane C:my foldermyfile.bat
#To learn more args for the wt command go here:
https://docs.microsoft.com/en-us/windows/terminal/command-line-arguments?tabs=windows#options-and-commands
# method 1
chmod +x <filename>
./<filename>
# method 2
sh <filename>.sh
# method 3 (Only for bash script)
bash <filename>.sh
include
#!/bin/bash
then in terminal
chmod +x <filename>
./<filename>
sh yourfile.sh
./file.sh
sh /path/to/file
bash yourfile.sh
./script-name-here.sh #Chage the "script-name-here" to the name of the .sh file.
self.returncode = subprocess. run(self.shellScriptPath, input='yes
', text=True).returncode