-2

when I try to use the command d2r-server.bat kg_demo_movie_mapping.ttl in the terminal, the command not found.

enter image description here And I tried to modify the .bash_profile as follow :

enter image description here

it's still not working.

Is there anyway to fix this?

The picture of bat file, and the terminal :

enter image description here enter image description here

imxitiz
  • 3,920
  • 3
  • 9
  • 33
Sun Yuting
  • 31
  • 1
  • 5
  • Where is `d2r-server.bat`? If it's in the current directory (under Downloads perhaps?), you'll need to tell bash to look there by prefixing your script name with ".\". You'd call the script using `.\d2r-server.bat kg_demo_movie_mapping.ttl`. (Note that a _.bat_ file usually indicates a Windows script and not something your can run on MacOS.) – Beggarman Oct 17 '18 at 09:20
  • Thank you! Somehow I have fixed the problem. But I still cannot run the command... It seems like the bat file exist some syntax errors. but when the file was run on the windows, it worked well. But I just download the folder from d2rq website, so how can I run a .bat on MacOS? I have tried to change the .bat to .sh, the syntax error still exist. – Sun Yuting Oct 17 '18 at 10:48
  • 1
    A windows batch file likely won’t run in MacOS at all. You will need to find a Mac version of the software you are using. – Beggarman Oct 17 '18 at 10:52
  • But there is no Mac version of d2rq, it's actually a folder I downloaded from http://d2rq.org/. – Sun Yuting Oct 17 '18 at 11:05
  • Took a quick glance at the project. Looks like the bash equivalents for the batch files are included (same name, but no .bat extension). – Beggarman Oct 17 '18 at 11:20
  • So does it mean I can run the command on the terminal? But there still exist some syntax errors. I am not familiar with the syntax of bat file, so I really don't know how to deal with it... Please check the picture in my answer. – Sun Yuting Oct 17 '18 at 12:00
  • 1
    You won't run the batch files on your Mac at all. There are other scripts for bash. Look through the files and you'll see them. – Beggarman Oct 17 '18 at 12:14

1 Answers1

0

Batch files are for Windows use. In a bash shell you'll need a bash script. Bash scripts can be identified by a shebang line at the top of the script, e.g.:

#!/bin/bash

In the specific case of the d2rq package there are scripts included. Look through the files in your downloaded package and you'll find the bash scripts share the same basename without the .bat extension of the windows batch files.

imxitiz
  • 3,920
  • 3
  • 9
  • 33
Beggarman
  • 866
  • 5
  • 7