1

I have two hosts, hosts A and B. A has a script (generate) that compiles my thesis:

#!/bin/sh
pdflatex Thesis.tex

When running this command on host A (console window) it works perfectly.

I am basically trying to connect from host B to A and run the generation command as an ssh remote command. All the keys are properly set. When I run the command, I get the following:

hostB> ssh user@hostA exec ~/Thesis/generate
This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
entering extended mode
! I can't find file `Thesis.tex'.
<*> Thesis.tex

I tried adjusting the script so that it considers the directory:

pdflatex ~/Thesis/Thesis.tex

But because the Thesis.tex inputs some others files (images), I get an error message.

I presume the problem is some sort of enviroment that doesn't exist in remote commands. How do I fix this?

2
  • what does generate look like? Commented Mar 18, 2014 at 22:28
  • The script generate is simply pdflatex Thesis.tex, as shown in my message. Commented Mar 20, 2014 at 9:59

1 Answer 1

1

ssh will run your command in your home directory. You probably wanted to run it in your ~/Thesis directory.

Just cd first and it should be fine:

ssh user@hostA 'cd ~/Thesis && ./generate'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.