Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What I am trying to do is to run the shell script 'ABCDE' on one machine, but use another machine to support it. ABCDE is an all-in-one ripper/encoder/tagger script for turning CD's into digital files. I have one machine which has a fast CD drive, but a slow processor, and another machine with a fast processor but a slow CD drive. I have set up SSH tunneling between the two, and also a SSH-fs, so the ripped files can be shared by both machines.

There is a configuration file in my home directory that allows me to set the path of the encoder. Here are the important lines (there are other relating to CD drive location, output format munging, etc):

OGGENCODERSYNTAX=oggenc         # Specify encoder for Ogg Vorbis

OGGENC=/usr/bin/oggenc          # Path to Ogg Vorbis encoder

OGGENCOPTS='-q 6'               # Options for Ogg Vorbis

OUTPUTTYPE="ogg"                # Type of file to create

When I try to put some indication to the script that the path to the encoder is elsewhere, I get problems.

For example:

OGGENC=`ssh WWW.XXX.YYY.ZZZ /usr/bin/oggenc` 

It runs the oggenc command before the rest of the shell script. And of course, since the oggencoder has no input at that moment, it gives an error message, and the program moves on to use a default setting from /etc/abcde.conf.

I have tried any number of combinations of " , ' , , \' , \ , \" , etc, but either it doesn't work at all, or it executes the oggencoder too early.

Please let me know what I'm doing wrong, or if this can even be done at all.

share|improve this question
OGGENC="ssh WWW.XXX.YYY.ZZZ /usr/bin/oggenc" should work; it definitely won't with the backticks (`). Show us in the script where $OGGENC is used. – freiheit Jul 18 '09 at 20:40
My knowledge of scripting is not the best, but I believe this is the pertinent code chunk (from the script ABCDE): (and I apologize, I can't get it to format correctly)... vorbis|ogg) case "$2" in %local*%) case "$OGGENCODERSYNTAX" in vorbize) $RUN_COMMAND nice $EFFECTIVE_NICE $OGGENCODER $OGGENCODEROPTS -w "$OUT" "$IN" ;; oggenc) $RUN_COMMAND nice $EFFECTIVE_NICE $OGGENCODER $OGGENCODEROPTS -o "$OUT" "$IN" ;; esac ;; *) $RUN_COMMAND nice $DISTMP3NICE $DISTMP3 $DISTMP3OPTS "$2" "$IN" "$OUT" >/dev/null 2>&1 ;; esac ;; – SethP Jul 19 '09 at 0:49
Buy a fast CD rom drive for 10 dollars ? ;-) – Kyle Brandt Jul 21 '09 at 14:16

Bear with me as I understand your setup.

If Machine-A is the fast-CD device and Machine-B has the fast-processor.
You seem to be running the job from Machine-A (to be close to the drive).
You have shared the file-space such that the ripped files
can be seen from Machine-B to be encoded and probably tagged too.

Now your problem is to fire the encoder operation remotely from Machine-A.

ssh user@Machine-B exec /shared/path/encodeScript /shared/path/$filename


  • $filename is the file to be encoded and
  • /shared/path is visible across the machines

should do individual file encoding on the remote Machine-B.

share|improve this answer
Thanks for your response. Should this like of code be put into the abcde.conf file? As in: OGGENC="ssh user@Machine-B exec /shared/path/encodeScript /shared/path/$filename" (with suitable substitutions)? The way that ABCDE works is to encode and tag the wave file, then delete it. So, at the end of the process only the ogg files are left. So I'm not sure if there will be a $filename for it to encode. – SethP Jul 18 '09 at 20:41
Your WAV file would be the filename reference. The script could delete the WAV or the caller can delete locally from Machine-A after the encoder remote call returns. – nik Jul 19 '09 at 4:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.