So I have a bash script like this:
#!/bin/sh
FILE='some_file.js'
gsed -i -E 's/something/somethingelse/' "$FILE"
echo "Modified File"
When I run this from command line, it echoes the last line, so no errors or something and makes changes to the file. I then try to create an Applescript with these contents:
set msg to do shell script "/path/to/script.sh"
display dialog msg
When I run it, it dutifully displays the dialog, but does not actually change the file some_file.js
.
How can this be possible?
Update: If I use sed -i "" -E 's/something/somethingelse/' "$FILE"
instead, it works.
PATH
alright. It's installed via macports. But setting the full path does help. I thought I would be alerted with an error message (as I have seen before) that the command was not found, but apparently the applescript just silently fails. – oarfish Feb 29 '16 at 21:40