Cannot run program "pandoc": error=2, No such file or directory - runtime

I am trying to use Pandoc to create a PDF from a .md file in a Processing sketch using the method below:
String[] command = {"pandoc", "-s", "-o", PDFname, "newFileName"};
Runtime rt = Runtime.getRuntime();
Process p = rt.exec(command);
(Where PDFname is a string), but I am getting the following error:
java.io.IOException: Cannot run program "pandoc": error=2, No such file or directory
when I run pandoc from terminal I have not problems, so I am not sure what is going wrong here.

Related

Error running a executable file in Mac Catalina

I am trying to run this exec file on my mac. I am not sure what the reason is for this error. I am trying to execute a binary file for a c program. The output should just be strings and the input is the trace.config and trace.dat files.

'gawk' is not recognized as an internal or external command, operable program or batch file. but other files in the similar path can be run in Cmd

I wan to run a code which should be read in Cmd using gawk. I have installed it in my program file directory. I also have installed another file named Grep.exe in the same directory:
enter image description here
when I try to run codes with these files I can run grep in cmd but I cant run gawk which is in the same directory. see the picture:
enter image description here
I thought the problem is with the path so I tried different things.
1
defining the path in cmd with this command and this link
setx path "%path%;c:\directoryPath"
define path in windows env using this link
Installing in different directory and adding env path
renaming the gawk.exe to ggawk.exe and trying to run
installing in other computrs
none of them work.
I dont know what is the reason that it can read other files in the same directory but not this specific .exe file that I need.

Directly move file output of command line program to a folder

I am running a command line program (macOS) which outputs a success message to the command line, and also creates some files which have the results of the program.
As I run this program many times with different parameters, I'd like to group the results in folders by parameters. Ideally if I run PROGRAM [param_1 = 1] [param_2 = 2] and then PROGRAM [param_1 = 1] [param_2 = 3] I'd end up with:
param_1_1
param_2_2
OUTPUT_FILES
param_2_3
OUTPUT_FILES
I have tried:
First create a folder output using mkdir -p, then do PROGRAM [param_1 = 1] [param_2 = 2] > output but that puts the success message in a text file named output and doesn't move the output files anywhere.
I have also thought of running my program and then using a bash script incorporating mv to move the files into folders by classifying by file name, but the file names are quite varied and, while likely possible, I'd love to skip this step if I can.
This happens because > only sends standard output to the file name to the right.
You could change the program itself (e.g. the way it opens file pointers), but if that isn't feasible:
If the files are all created in either a path relative to where the program is run, then cd into a different directory before running, so the mv step is more straightforward
If they output to a path where there are no other files, you can make that path into a symbolic link using ln where the real path is the output directory
Otherwise it may be necessary to do what you suggested.

can't run .sh or .py file directly from bashoperater

I am trying to run python script from bash command in airflow, I even tried running the .sh file from the bash command which may trigger the python file. But it keeps giving me error "No such file or directory". I just can't figure out the path to be given to the file.
I have tried specifying different paths to reach the directory also changed permissions of the files to 777 but still no change
t1 = BashOperator(
task_id='requestpage',
bash_command="/home/username/runfile.sh ",
dag=dag,
)
above is the defined task but it never executes.

Shell script is not working on Oozie using Hue

I am running Shell script on Oozie using Hue, when the workflow job is submitted the following error is shown:
Cannot run program "FileManipulation.sh"
(in directory "/hadoop/mapred/local/taskTracker/root/jobcache/job_201503271756_0277/attempt_201503271756_0277_m_000000_0/work"):
java.io.IOException: error=2, No such file or directory
What could be the reason ?
Please check directory permission containing FileManipulation.sh file. Give all read, write and execute permissions to directory and its file. Also add path to the shell script in both "Shell command" as well as "Files", sometimes this may cause same problem.

Resources