Command Line Manual

Shake started in its infancy as a command line compositor, which means you can conceivably execute a five hundred node script all typed out in a Terminal. "Conceivably," but not practically, since nodes like Primatte, Stabilize, Paint or RotoShape all have unwieldy formats, and of course you would be typing out 500 nodes on the command line, which is nobody's idea of a fun way to spend the day. However, using a Terminal does remain an ideal method to execute many daily image processing functions, such as:

All of these can be rendered in the command line more quickly and efficiently than in the interface (assuming one is comfortable with typing in the Terminal), since they involve relatively straightforward commands. The other major use of the command line is to execute scripts you have created in the interface and have then saved to disk.

This section of the documentation discusses a few general principles about the command line shell, and then lists out several examples. The last section is a list of frequently used functions. As every node can potentially be used, this not a complete list.

Example Images: All images are in doc/pix. All examples assume you are in this directory or below it, as noted.

 

Viewing, Converting and Writing Images

Shake does three basic things on the command line: It executes image operations, scripts, or views images. Here are some simple examples to start the discussion.

For more information on the flipbook, jump to Interface - Flipbook.

 

Time and Viewing Image Sequences

Shake assumes time is set to frame1 unless you otherwise specify a time range. This is done with the -t option, and a frame numbering symbol, something like this:

shake alien/alien.#.iff -t 1-50

The frame numbering is substituted with a symbol (# in the above example) which indicates that the file is padded to four places. You can use other symbols:

Shake format Reads/Writes...
image.#.iff image.0001.iff, image.0002.iff, etc.
image.%04d.iff image.0001.iff, image.0002.iff, etc.
image.@.iff image.1.iff, image.2.iff, etc.
image.%d.iff image.1.iff, image.2.iff, etc.
image.@@@.iff, image.###.iff image.001.iff, image.002.iff, etc.
image.%03d.iff

image.001.iff, image.002.iff, etc.

image.10-50#.iff image.0010.iff at frame 1, 11 at frame 2, etc.

 

The -t option is extremely flexible. You can choose to render frame ranges, stepped ranges, individual frames, or any combination:

Time Range Number of Frames Frames Rendered
-t 1-100 100 1, 2, 3...100
-t 1-100x2 50 1, 3, 5...99
-t 1-100x20 5 1, 21, 41...81
-t 1-20,30-40 31 1,2,3...20, and 30,31,32...40
-t 1-10x2,15,18,20-25 13 1,3,5...9,15,18, 20, 21, 22 ...25
-t 100-1 100 100,99,98...2

 

Therefore, to convert a sequence of images, you might do something like:

shake alien/alien.#.iff -fo test.@.jpg -t 1-30 -v

 

Here are some clever renumbering tricks:

Renumbering Clips

In doc/pix/bus:

shake bus2.40-79#.jpg -t 1-40 -fo toto.#.iff -v

Shifts frame numbering to start at 1

shake bus2.#.jpg -t 40-79 -fo toto.#-39.iff -v

Also shifts frame numbering to start at 1

shake bus2.#.jpg -t 40-79 -fo toto.80-#.iff -v

Reverses timing starting at frame 1.

shake bus2.#.jpg -t 40-79 -fo toto.118-#.iff -v

Reverses timing within the same frame range.
shake bus2.#.jpg -t 40-79 -fo toto.@.iff -v Unpads the clip
shake bus2.40-79x2#.jpg -t 1-20 -fo toto.#.iff -v Halfs the timing of the clip
shake bus2.40-79x.5#.jpg -t 1-80 -fo toto.#.iff -v Doubles the timing of the clip

 

Appending Functions

Append optional functions with the - sign to preface each function call, followed by a space for any arguments it might take. Not all functions take arguments, but most do. Here, Blur has an argument of 50, which is the amount of blur you want to apply:

shake truck.iff -blur 50

You can append as many functions as you want:

shake truck.iff -blur 50 -invert r -z 2

Here is a good example of a common command line test of 3D-rendered imagery:

shake truck.iff -outside sign_mask.iff -over bg.iff

You don't have to type out the entire function name as long as there is no ambiguity. For example,

shake bg.iff -bri 2

calls the Brightness function since there are no functions starting with bri. However, calling

shake bg.iff -con 2

informs you that it can't choose between Conform, Constraint, ContrastLum, ContrastRGB or Convolve. Replacing your command with enough letters to end the ambiguity solves the problem:

shake bg.iff -contrastl 2

This calls the ContrastLum function.

A note concerning capitalization and function names. In the interface, function names are always capitalized. In the command line, they are always lower-case so you don't have to resort to pressing the Shift key. The only exception is when you call up a function in quotes, such as the Linear function used to animate parameters:

shake truck.iff -blur "Linear(0,0@1,20@20)" -t 1-20

For more information on animation curves, jump to Overview - Splines.

Most functions are image manipulators – they will modify the image you load. Others are controls to modify how Shake executes the command. For example, -brightness 2 brightens an image, but -fps 24 loads a flipbook preset to twenty-four frames-per-second. Although image functions always happen in a linear fashion, that is, the order of commands matters, controls can be placed anywhere. For example, the following lines are identical:

shake alien/alien.#.iff -rotate 45 -t 1-50 -cpus 2
shake -cpus 2 -t 1-50 alien/alien.#.iff -rotate 45

However, the following two lines are different:

shake truck/truck.iff -pan 200 0 -rotate 135
shake truck/truck.iff -rotate 135 -pan 200 0

If you place a second control on a line, it replaces the previous setting. For example,

shake alien/alien.#.iff -t 1-50 -fps 24 -bri 2 -fps 30 -t 10-20

plays at thirty frames-per-second and only render frames 10-20.

 

Getting Help

How do you know what Blur is expecting? Outside of using the product non-stop for five years, you can also type

shake -help blur

and it returns what arguments that function takes. Blur actually has six arguments:

-blur [xPixels] [yPixels] [spread] [xFilter] [yFilter] [channels]

Often, you don't need to specify all arguments. Shake indicates if it is expecting more arguments than you have supplied with a nice cheery error message.

You can also jump to the help page, under Functions By Class or Functions By Name. For example, the Blur page looks like this: Jump To Blur.

You don't have to know the entire function name. For example, your shrill call for help on blur probably called up about seven different functions. Try

shake -help mul

and you see that Shake simply looks for the string "mul".

How to quickly launch these docs?

shake -docs

 

Argument Flow

Looking at the arguments in the documentation, the Blur page lists that it expects an image as its first input, which is labeled In:

image Blur( 
  image In, 
  float xPixels, 
  float yPixels, 
  int spread, 
  const char * xFilter, 
  const char * yFilter,
  const char * channels
);

However, the command line differs from the interface in that it always assumes the first image argument is coming from the previous argument in a linear flow, so omit the first image argument. Therefore, in Blur, the first argument on the command line is the xPixels parameter.

Shake assumes the previous image is fed into the function that follows. However, if you have multiple input images, only the last image has the effect applied to it. In this example, only sign_mask.iff gets blurred:

shake truck.iff bg.iff sign_mask.iff -blur 50

Occasionally, you want to do different operations to two different images within the same command. This can be done with the branching commands -fi (FileIn) and -label. Label a branch with the -label function, and start a new branch with the -fi function. The following example blurs the background, and then assigns it a temporary label of BG. It then reads the truck, brightens it up (but not the background), and composites the result over the blurred background:

shake bg.iff -blur 50 -label BG -fi truck.iff -bri 2 -over BG

 

Scripts

Execute pre-saved scripts with the -exec command. These scripts are usually generated from the interface. The -exec functionscans the script and executes all FileOut nodes. If there are no FileOuts in the script, the function does nothing.

shake -exec my_script.shk -v

The -v stands for verbose, and gives you feedback on the progress of the render.

You can override many settings in the script:

shake -exec my_script.shk -v -proxys .5 1 -t 20-30 -motion 1 1

renders at half proxy scale, full proxy ratio, only frames twenty to thirty, and activates motion blur without having to edit the script itself.

You can save a script from the command line with the -savescript function:

shake truck/truck.iff -outside truck/sign_mask.iff -over truck/bg.iff -savescript toto.shk

If there is no FileOut in the script, you can test the script with the -script command. It is similar to the -exec function in that it executes FileOuts. However, it also views every branch in the script, which can be awkward when rendering. It is really just for testing scripts:

shake -script toto.shk

 

 

Command line Controls

<> indicates a mandatory argument. [] indicates an optional argument

All examples are executed inside doc/pix/truck.

These functions are unique to the command line.

time range control
-t <frameRange> See above under Time
i/o functions
-exec <script.shk> Renders only FileOuts in a script. See above under Time and Image Sequences.
-fi <image> FileIn. Allows branching operations. See above under Argument Flow.
-fo <image> FileOut. Writes the image to disk in the format of the file extension. If no extension is given, it is saved in .iff format.
-savescript <script.shk> Saves all of the previous commands into a script for later execution. Also helpful to get scripting formats.
-script <script.shk> Reads a script and tests it. All branches are viewed, all FileOuts are rendered to disk.
viewing controls

-compare <image>

Example:

shake bg.iff -blur 20 -compare bg.iff

Allows you to compare two images. Use Alt+left mouse (Shift+Ctrl+left mouse on Linux) to drag between the images. H and V split the screen between horizontal and vertical splits.

-fullscreen IRIX only. Blackens the entire screen around the flipbook.
-fps <framesPerSecond> Fps for the playback. Also set this by pressing +/- on the keypad. The actual and target fps is displayed at the top of the flipbook.
-gui Launches your functions into the interface.
-monitor [keepFrames] [w] [h] With no options, this only displays the current frame, discarding it when you go to the next frame. When keepFrames is 1, it keep all frames in memory. When it is 0, it discards them. You can also specify the width and height of the monitor window.
-view [zoom] Can be used to view intermediate stages of a string of nodes. You can also list an optional zoom level for the viewer.
information controls
-doc Launches this fine and flawless documentation.
-help, -h [functionName] Without any arguments, it lists all functions available in Shake. When you supply a string, it will match up any functions with that string in it. See above under Getting Help.
-info Will list out size, type, bit depth, and channels information regarding your image.
-version Prints the version of Shake.
-v, -vv Verbose. When -v is on, the rendering time is printed for each frame. -vv displays a percentage of render completion as it renders.
render controls
-cpus <procs> The number of cpus to use. Default is 1.
-createdirs This is used with -renderproxies to create the necessary subdirectories for the proxies. It does not affect FileOut renders.
-fldr <field> Turns on field rendering. 1 = odd/pal, 0= even/ntsc
-mem <Mb> Sets the maximum amount of memory to use.
-motion <quality> <override> Sets the motion blur quality. In the command line, you must turn on the override (set it to 1). When executing a script, you either multiply what is saved as the global motion blur value (override = 0), or override it (override = 1).
-node <nodeName> Only executes that node. For use with -exec.
-nocache Disables the call to the cache, forcing complete recomputation of each element.
-noexec Does nothing except compile the script to see if there are errors.
-pixelscale <scale> [ratio] Sets the pixelscale and ratio. Not used frequently in the command line. See Overview - About Proxies
-proxyscale <scale> [ratio] Sets the proxyscale and ratio. Does a low-resolution test render of your commands. You can specify two numbers, which are the scale and ratio, or p1/p2/p3 which uses the preset proxies. See Overview - About Proxies
-renderproxies [p1] [p2] [p3] Renders out FileIns already saved into a script as the pre-set proxies. If used without arguments, renders what is saved in the script, otherwise you can specify which subproxies you want, p1, p2 and/or p3. Usually used with -createdirs.
-sequential Sequentially executes functions. For use with -exec. When you have multiple FileOuts, it may be more efficient to render them one at a time with this flag, rather than simultaneously.
-shutter <shutterTiming> [offset] Sets motion blur shutter controls.
quality controls
-fast [quality] When no argument is given (just -fast), it turns off anti-aliasing to speed up the render. When using -exec to render a script that has the global quality set to low, you can turn it back on with -fast 1
masking controls

-evenonly <image>

Example:

shake bg.iff -rotate 45 -evenonly bg.iff

Only executes the previous commands on the even fields of the image, mixing it back in with the image you supply.

-isolate <image> <channel>

Example:

shake bg.iff -blur 50 -isolate bg.iff a

Only executes the previous commands on the channels you specify, mixing it back in with the image you supply.

-mask <image> [channel] [percent] [invert]

Example:

shake bg.iff -blur 50 -mask truck.iff

Masks off the previous commands you specify, with the mask coming from image. You can specify the channel and percentage, or invert the mask.
-oddonly <image> Only executes the previous commands on the odd fields of the image, mixing it back in with the image you supply.
-roi <left> <bottom> <w> <h> Only executes a square portion of the image that you specify
labeling controls
-curve [type] <name> <defaultValue> Create a global variable available to the script that is loaded or other functions executed. See below for an example.
-label <name> Allows you to temporarily label an image for later use in the command line.

 

Frequently Used Functions

Since you can use any of the functions in Shake, this is only a partial list. However, it represents the functions that are both practical to use (not too many parameters), and are useful in the command line, such as file resizing, basic channel manipulation, quick generation of test elements. Typically, the functions have more options than are listed here. For more information on the functions, jump to the appropriate documentation page.

image functions
-addtext <text> This is a quick way to generate text, as you only have to supply the text itself, without having to enter the width, height, and bit depth.
-black [w] [h] [bitDepth] A quick way to generate black.
-color <w> <h> <bitDepth> <r> <g> <b> [a] [z] A color field.
-ramp [w] [h] [bitDepth] [orientation] A ramp. Use an orientation of 1 for vertical, 0 for horizontal.
-text <w> <h> <bitDepth> <text>  
color functions
-brightness <value> Multiplies the RGB channels by value.
-contrastlum <contrast> [center] Performs a contrast, with the pivot point at center.
-delogc A log to linear color conversion to quickly see cineon plates.
-gamma <value> Hmmm....what could this do?
-logc A linear to log color conversion to convert files into log color space.
-luminance A quick function to generate a black-and-white image based on the luminance. Generates a 1-channel image.
-mult <r> <g> <b> [a] [z] Multiplies color on a per-channel basis.
-saturation <value> Saturation change. No, really.
channel functions

-colorspace

Example:

shake bg.iff -colorsp rgb hls

Converts images to a different colorspace. Indicate the source space and the destination space.
-copy <image> <clipmode> <channels> Copies a channel from your listed image to the incoming image. Clipmode indicates which resolution you want, with 1 being the second image, 0 being the input image.
-forcergb Forces a BW or BWA image into RGB or RGBA format. This is unnecessary in the GUI, and can be handled by FileOut for output, but is awkward in the command line, thus this function's raison-d'etre.

-reorder <channels>

Examples:

shake truck.iff -reorder aaaa
shake truck.iff -reorder rgbl
shake bg.iff -reorder grb

Swaps channels. Using letter codes (r, g, b, a, z, l for luminance, and n for null), indicate what channel should go in the r,g,b,a,z channels.
-setalpha <value> Sets the Alpha to your value. To remove an Alpha channel from an image, enter 0.
-switchmatte <image> Similar to Copy, except only the Alpha is swapped. The returned image is premultiplied.
compositing functions
-inside <maskImage> An inclusion matte. Multiplies the incoming image by the Alpha channel of the image you name.
-isuba <Image> This extracts the absolute difference between the two images.
-mix <Image> [percent] Mixes two images together. A percent of 50 means half of each image.
-outside <maskImage> An exclusion matte. Multiplies the incoming image by the inverse of the Alpha channel of the image you name.
-over <backgroundImage> Puts the incoming image, assumed to be the premultiplied foreground, over the background..
-under <foregroundImage> Puts the incoming image underneath the image you list, which is assumed to be premultiplied.
-screen <image> Performs the Screen operation, which is good for reflections and glows.
resizing functions
-addborders <xBorder> <yBorder> Pads the image out with black around the edges
-crop <left> <bot> <right> <top> Crops the image to the two corners you specify. The origin is in the lower-left corner.
-fit <xRes> <yRes> Resizes the image to the resolution you specify, maintaining the aspect ratio.
-resize <xRes> <yRes> Resizes the image to the resolution you specify.
-window <left> <bot> <xRes> <yRes> Crops the window at the specified lower-left corner, and to the resolution you specify.
-z <zoom> A shortcut for Zoom, both X and Y are zoomed by the same amount.
-zoom <xZoom> <yZoom> Zooms the image in X and Y independently.
filter functions
-blur <xPixels> [yPixels] Blur, baby!
transform functions
-flip Turns the image upside down.
-flop Turns the image backwards.
-pan <xPan> <yPan> Pans the image.
-rotate <angle> Rotates the image.
-scale <xScale> <yScale> Scales the image without changing the resolution.
video field functions
-deinterlace <field> [mode]

Deinterlaces the image. 0 equals the even field, 1 equals the odd field. For mode,

0 = replication of the line below,
1 = interpolation of the missing line between two lines above and below,
2 = blur. 50% of the line, 25% each of the two lines above and below the missing line.

-evenonly <image>

Example:

shake bg.iff -rotate 45 -evenonly bg.iff

Executes the previous commands on the even fields of the image, mixing it back in with the image you list.
-field <field> Extracts just one field, creating a half-height image. 0 =even field, 1 = odd field.
-fldr <field> Activates field rendering. 1 = odd/pal, 0= even/ntsc.
-interlace <image> <clipMode> <field> Interlaces the two images. clipMode of 1 means the bg resolution is taken, 0 means the incoming image resolution is taken.

0 =even field, 1 = odd field.
-oddonly <image> Will only execute the previous commands on the odd fields of the image, mixing it back in with the image you supply.

-pulldown <image> <field> [offset]

Example:

shake bus/bus2.40-79#.jpg 0 -t 1-50

Acts as a FileIn, going from 24 fps to 30 fps, interlacing the frames to add the extra frames. 0 =even field, 1 = odd field. The offset amount is the frame at which the interlacing starts after the beginning.
-pullup <image> <field> [offset] Acts as a FileIn. Removes the 3:2 pulldown interlacing, going from 30 fps to 24 fps. 0 =even field, 1 = odd field. The offset amount is the frame at which the interlacing starts after the beginning.
-swapfields Switches the odd and even fields.
other functions
-average <image> <sStart> <sEnd> <dStart> <dEnd> <bytes> <gain> <scale> Acts as a -bytes <bytes> , averaging frames down from sStart and sEnd to dStart and dEnd. I usually use 1,1,1 for the last three arguments.
-bytes <bytes> 1 = 8 bits, 2 = 16 bits, 4 = float.

 

Examples

Looking at Images

In doc/pix/truck:

shake bg.iff sign_mask.iff

 

shake *

Uses the UNIX-style wildcard, *. This means "anything".

shake *.iff

Indicates "anything with an .iff extension"

shake bg.iff -compare sign_mask.iff

This compares the two images, using Alt+left mouse to drag between the two. For Linux, you have to drag Shift+Ctrl+Left.
Launching Flipbooks

In doc/pix:

shake alien/alien.#.iff -t 1-50
shake bus/bus2.#.jpg -t 40-79
shake bus/bus2.40-79#.jpg -t 1-40
shake fan/fan.@.iff -t 1-5

 

Cool Text Tricks

shake -addtext %t -t 1-20

Prints time code

shake -addtext %T -t 1-20

Prints full time code

shake -addtext %f -t 1-20

Prints the current frame

shake -addtext %F -t 1-20

Prints the padded current frame
shake -addtext "%D, %d %M" Prints the current date
Converting image file formats

In doc/pix/alien:

shake alien.#.iff -t 1-50 -fo temp.@.sgi

Writes 50 unpadded images in the .sgi format

In doc/pix/fan:

shake fan.@.iff -t 1-5 -fo fan.#.tif

Writes 5 padded images in the .tif format.
Adding and Removing Channels

In doc/pix/alien:

shake alien.0001.iff -lum -fo toto.iff

Creates a black-and-white image with an Alpha channel.

shake alien.0001.iff -reorder rrra -fo tutu.iff

 

Creates a black-and-white image with an Alpha channel

shake tutu.iff -forcergb

To make a 1-channel image into a 3-channel image without modifying it.

shake alien.0001.iff -reorder rgbn

Removes the Alpha channel

shake alien.0001.iff -setalpha 0

Removes the Alpha channel

shake alien.0001.iff -reorder rgbl

Puts the luminance into the Alpha channel
Changing bit-depth

In doc/pix/truck:

shake bg.iff -bytes 1 -fo bit8.iff

Converts the image to 8 bits, which the image was at anyway...

shake bg.iff -bytes 2 -fo bit16.iff

Converts the image to 16 bits.

shake bg.iff -bytes 4 -fo bit32.iff

 

Converts the image to float.
Manipulating Fields

In doc/pix/bus:

shake -pulldown bus2.40-79#.jpg 0 -t 1-50 -fo fps30.#.iff -v

3:2 pulldown, going from 24 to 30 fps. The 1-50 is derived by subtracting 40 from 79, adding 1, and then multiplying that by 1.25.
shake -pullup fps30.#.iff 0 -t 1-40 -fo fps24.#.iff -v 3:2 pulldown going from 30 to 24 fps.The 1-40 is derived by dividing 50 (the amount of images) by 1.25.
Averaging Frames

In doc/pix/bus:

shake -average bus2.40-79#.jpg 1 40 1 20 1 1 1 -t 1-20

Averages the 40 frames down to 20 frames.

shake bus2.40-79x2#.jpg -mix bus2.41-79x2#.jpg -t 1-20

Uses the frame numbering steps in the FileIn to get the averaging, mixing them together with the Mix function.
Resizing Images

In doc/pix/truck:

shake bg.iff -z 3

Zooms the image up by 3.

shake bg.iff -z .333
shake bg.iff -z 1/3

Both zoom the image down by 3.
shake bg.iff -zoom 2 1 Zooms the image to twice as wide.
shake bg.iff -resize 720 486 Zooms the image to NTSC resolution.
shake bg.iff -fit 720 486 Zooms the image to NTSC resolution, maintaining the original aspect ratio.
Renumbering Clips

In doc/pix/bus:

shake bus2.40-79#.jpg -t 1-40 -fo toto.#.iff -v

Shifts frame numbering to start at 1.

shake bus2.#.jpg -t 40-79 -fo toto.#-39.iff -v

Also shifts frame numbering to start at 1.

shake bus2.#.jpg -t 40-79 -fo toto.118-#.iff -v

Reverses timing.
shake bus2.#.jpg -t 40-79 -fo toto.@.iff -v Unpads the clip.
shake bus2.40-79x2#.jpg -t 1-20 -fo toto.#.iff -v Halfs the timing of the clip.
shake bus2.40-79x.5#.jpg -t 1-80 -fo toto.#.iff -v Doubles the timing of the clip.
Compositing

In doc/pix/truck:

shake truck.iff -outside sign_mask.iff -over bg.iff

 
shake bg.iff -under truck.iff  
Animating Parameters

In doc/pix/truck:

shake bg.iff -blur "Linear(0,0@1,100@20)" -t 1-20

A linear animation from a value of 0 at frame 1 to a value of 100 at frame 20.

In doc/pix/truck:

shake bg.iff -rotate "Linear(0,0@1,360@11)" -t 1-10

Animates a rotating from 0 degrees at frame 1 to 360 degrees at frame 11. Notice only up to frame 10 is rendered, hopefully giving a smooth loop.

In doc/pix/truck:

shake bg.iff -rotate "Linear(0,0@1,360@11)" -t 1-10 -motion .5 1

Sets motion blur at half quality.

In doc/pix/truck:

shake truck.iff -curve A "JSpline(1,0@1,10@5,300@15)" -pan A A -t 1-15

Creates a temporary curve named A. It has values of 0 at frame 1, 10 at frame 5, and 300 at frame 15. It also continues its slope after frame 15. This curve is then fed into the x and y pan parameters of the Pan.

In doc/pix/truck:

shake bg.iff -rotate "time*time" -t 1-75 -motion .5 1 -cpus 2

Uses the time variable, placing it in quotes to multiply it by itself. As the frame count increases, the angle increases. I also turn on both of my cpus for my 2-proc box.

In doc/pix/truck:

shake truck.iff -pan "cos(time*.5)*100" "sin(time)*50" -motion .5 1 -t 1-13

Uses the cos and sin functions to animate the truck in a figure-8.

In doc/pix/truck:

shake bg.iff -rotate "cos(time*.5)*50+25" -t 1-13 -motion .5 1

 
Substituting Values with -curve

f you have this in a script called myscript.shk:

Text1 = Text(720, 486, 1, {{ stringf("myVal = %d %s", myVal, slatestring); }}, "Utopia Regular", 100, xFontScale, 1, width/2, height/2, 0, 2, 2, 1, 1, 1, 1, 0, 0, 0, 45);

You substitute values in with the -curve option:

shake -curve int myInt 5 -curve string slatestring "SuperSlate" -script myscript.shk

and you get a nice image that says "myVal = 5 SuperSlate".

Or you could do:

shake -curve int myVal 5 -curve string slatestring "SuperSlate" -text 720 486 1 ' :stringf(\\\"myVal = %d\\n%s\\\", myVal, slatestring ) ; '

Note the extra backslashes – this quotes it once for the shell then and again for Shake. The shell sees \\ and makes it \ then \" and makes it " so you get a result of \" going into the shake wrapper script which is then passed properly into the Shake executable. Whew.

 

 

Tips

File Completion. Is it a pain to type all of those file names? Here is a shortcut using the file completion in the shell. Whenever you press Tab, it lists all potential files that match what you type. For example, in doc/pix:

shake trTAB

lists

shake truck/

Pressing it again lists all three images files within that directory. Typing another t, that is,

shake truck/tTAB

lists

shake truck/truck.iff

You can therefore type the entire line with very few keystrokes. Try typing this:

shake tTABt tTABbTAB tTABsTAB

It lists out the following line:

shake truck/truck.iff truck/bg.iff truck/sign_mask.iff

So just press Enter.

Repeating previous commands. You can repeat previous commands in one of two ways.

The first is to use the Up arrow on the command line. Each time you press it, it will list out the previous command, stepping back through your history. Change portions of the command with the use of the Left and Right arrows. Pressing the Down arrow takes you to the next command in the history list.

The second way is to use the ! key. pressing !! repeats the last command, although pressing up arrow is easier. pressing !s repeats the last command that started with "s".

Wildcards. Use wildcards in the command line so you don't have to type lots of things. Here are a few of them:
Wildcards

*

Matches everything of any length.

In doc/pix/truck:

shake *

Shows all files within that directory simultaneously.

shake *.iff

Shows all files within that directory that have a .iff extension.

shake *g*

Displays bg.iff and sign_mask.iff.

?

This is used to match anything for just that position

In doc/pix/alien:

shake alien.000?.iff

Displays the first 9 images simultaneously.

shake alien.002?.iff

Displays all frames in the twenties.

[range-range]

This can describe a range, either between letters or numbers.

In doc/pix/alien:

shake alien.000[1-5].iff

This will display the first 5 images simultaneously.

In doc/pix/alien:

shake [l-z]*

Displays all images that start with the letters l to z, lower-case.

 

Math and Expressions When doing math on the command line, enclose it in "quotation marks":

In doc/pix/truck:

shake truck.iff -pan "cos(time*.5)*100" "sin(time)*50" -motion .5 1 -t 1-13

 

Multiple Words When you want to use more than one word in a parameter that expects a string (letters), again, use "quotation marks":

shake -addtext "kilroy was here"