I create a test.command file with contents

 mono /Users/wlad2/Desktop-1_1/AdvancetsParser2.exe 

The file is located on the path /Users/wlad2/Desktop-1_1/AdvancetsParser2.exe . When you start the program, it starts reading the domen.txt file from the current folder, but when you start the file, for some reason it starts to refer to the root /Users/wlad2/ and look for the file there.

enter image description here

  • if I understand the settings of your PS1 ( w2:~ wlad2 ) w2:~ wlad2 , your home directory ( ~ ) is the current directory. accordingly, this property is inherited by the child process ..2.exe and it tries to work with the ~/domen.txt . What behavior did you expect? - aleksandr barakin
  • And how to temporarily change it (current directory)? Or are there alternatives? - Rajab

1 answer 1

I don’t quite grasp what meaning you put into the words “temporarily change”, but if you need the mono ... command to run in a different current directory, add a command to change the current directory in the test.command file, so that the test.command file test.command looked like this:

 cd /каталог.из.которого.надо.брать.файл.domen.txt/ mono /Users/wlad2/Desktop-1_1/AdvancetsParser2.exe