10

Can't explain why this is happening. Here's the script:

#!/bin/bash
echo "Hello World"

Here's the terminal output:

$ python ./test.sh 
    File "./tellapart_mac_setup.sh", line 2
        echo "Hello World"
        ^
SyntaxError: invalid syntax

$ echo "hello world"
hello world

$ which bash
/bin/bash

$ /bin/bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin14)
Copyright (C) 2007 Free Software Foundation, Inc.
Sam Odio
  • 2,717
  • 5
  • 22
  • 25

1 Answers1

26

Looks like you're parsing it with python, since it's not a python script - it of course will throw errors in python's compiler.

It's a bash script, so just use bash to process it:

./test.sh
scrowler
  • 24,273
  • 9
  • 60
  • 92