1

I use LaTeX and rubber to compile my tex sources via command line. The command I usually use is rubber --pdf test.tex && rubber --clean test.tex. How can I create a custom command so that I only have to type rubber text.tex or rubb text.tex (or something like this) for it to do the same as the long command above?

Til Hund
  • 605
  • 2
  • 8
  • 16

1 Answers1

2

I would use something simple, like

#!/bin/bash
rubber --pdf $1 && rubber --clean $1

then you save it in a folder in your $PATH and you are done.

I usually suggest to create (if not present) the folder ~/bin to contain your user's scripts, and then add it to your $PATH variable, following this solution.

dadexix86
  • 6,596
  • 2
  • 39
  • 113
  • 1
    +1. Notice that in recent Ubuntu, `~/bin` is added by default to the PATH if it exists (in `~/.profile` you should have the needed code). – Rmano Mar 11 '16 at 08:47
  • @Rmano thanks! I have a very old home directory that I carried along since 8.10, so I missed that change :) – dadexix86 Mar 11 '16 at 08:52