Skip to main content

How to run a shell script from inside Mathematica

I have a very basic question. I have a shell file test.sh that prints let's say Yeah to a file called output.txt:

#!/bin/sh

echo "Yeah" > output.txt

I am running the Run command from the notebook:

Run["sh test.sh"]

But it is not creating the file output.txt. Can anyone tell me please what is going wrong?

Sayak
  • 121
  • 1
  • 4