I have a txt file called exec.txt, that I have made executable using chmod. Running it from the shell using ./exec.txt works correctly. However, I need to run it from my Mathematica nb file.
Following is what I tried:
Run[NotebookDirectory[] <> "exec.txt"]
This throws me an output of $0$ in the nb (which is supposedly what I should observe if the code worked properly), but I don't get the desired output from the executable. Both the executable and the nb are in the same directory.
However, opening Mathematica kernel from the shell (after entering the directory of nb and executable) and then trying the following command provides the desired result:
Run[Directory[] <> "/exec.txt"]
What should I do to get the desired result from my nb file?
Details about exec.txt:
It contains just the following line:
tr '{}' '[]' <fileABC.dat | tee fileABC.dat
which simply replaces all curly brackets in the dat file with square ones. This is what I mean while saying "desired result".