Examples in Python, Perl, Powershell, Bash and Windows batch.
## NOTE
## 1. For Powershell,
## (a) To allow hyphen (-) to be used as a script parameter e.g. to run yourscript.ps1 4 - 2 ## use : powershell yourscript.ps1 4 - 2 ## or : powershell -Command yourscript.ps1 4 - 2 ## instead of : powershell -File yourscript.ps1 4 - 2
## (b) To use ^ as the operator parameter enclose in double quotes e.g.
## yourscript.ps1 4 "^" 2 ## (c) If you want to associate .ps1 files to be executed by powershell.exe, Open Windows command prompt as administrator
## assoc .ps1=Microsoft.PowerShellScript.1
## and either:-
## ftype Microsoft.PowerShellScript.1=%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe "%1" %*
## or ## ftype Microsoft.PowerShellScript.1=%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -Command "%1" %* ## Below is a comparison of running the the script with powershell.exe and passing hyphen (-) as one of the parameters
## 2. For Bash,
## (a) When passing arguments to the script for multiplication using * as the operator symbol, bash may
## perform globbing of * to match all files on the current working directory. To avoid this, we use
##
## set -o noglob
##