I learned that you can write scripts and run multiple commands by executing a .sh or .ps1 file in Bash and PowerShell respectively. However, when I run my files I get the same error (both in Bash and PowerShell) and I am unable to understand why.
Python version I’m running is 3.11.4
Script I’m trying to run is:
python3 -c "print(1)"
Error message I receive is:
python3 -c "print(1)"
^^^^^^^^^^
SyntaxError: invalid syntax
The fact that it shows the contents of the file it means it is running it, but I’m unable to figure out what’s the problem with the syntax.