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.
0

1 Answer 1

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
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.