0

I'm just trying to change this path with a simple shell script. If I type in the commands one by one it works no problem. If I put it in a shell script and run it it runs fine with no errors but does not alter the path.

#!/bin/bash
export PATH=~/Library/Python/3.4/bin:$PATH
source ~/.bash_profile

What am I doing wrong here?

If I double click on the file the output is...

    /Users/Parthenon/Desktop/ShellScripts/changeawsebpath ; exit;
Philips-MBP:~ Parthenon$ /Users/Parthenon/Desktop/ShellScripts/changeawsebpath ; exit;
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]
Phil Andrews
  • 6,241
  • 8
  • 38
  • 64
  • 2
    How are you running the script and where are you expecting `PATH` to be changed? A script cannot alter its parent's environment, you must `source` for that to happen – Eric Renouf Oct 20 '16 at 18:09

1 Answers1

-2

The =~ is an conditional BRE operator vs an assignment

jas-
  • 1,750
  • 1
  • 17
  • 28