inform6 command line issue on macos

using the command line and inform 6.45

inform6 -r $TRANSCRIPT_FORMAT=1 <game-path>\<game>.inf

in the macos terminal doesn’t seem to work. for instance, if the game is “main.inf” the resulting error message is:

zsh: 1 not found

using bash the error is:

"<before compilation>", line 0: Fatal error: Couldn't open source file "=1.inf"

which looks to me like the command isn’t being parsed appropriately.

no combination of quotes, brackets, using full path i’ve tried seems to fix this.

the workaround is simply to copy $TRANSCRIPT_FORMAT=1 into the compiler options in main.inf but it’s odd that it doesn’t work from the command line.

the default, BTW, works fine:

inform6 -r main.inf

If I do it like this:

inform6 -r '$TRANSCRIPT_FORMAT=1' <game-path>/<game>.inf

That works. Note that I needed the single quotes. Without that, Zsh and Bash will interpret the $ symbol as a shell variable. Or I can do it like this:

inform6 -r --define TRANSCRIPT_FORMAT=1 <game-path>/<game>.inf

That, too, seems to work.

The dollar sign marks a shell variable, so you need to escape it. Right now it’s being read as inform6 -r =1, because $TRANSCRIPT_FORMAT is not an existing variable.

EDIT: Too slow!

ah. i had tried everything EXCEPT single quotes.

1 Like

The -- syntax above is definitely good to remember (particularly if you even want to call Inform6 from other places, like a Makefile or a script). The amount of quoting you need to get a literal-dollar-sign can be frustrating at times, and the --define skips all that ugliness.

1 Like

Just remember that if you’re putting an option at the top of a source file, like

!% $OMIT_UNUSED_ROUTINES=1;

…then you have to use the $ form (without quotes). The -- form is command-line only.

that part i, thankfully, did figure out. i had no idea about the rest, though. is this handling of shell variables a specific quirk of macos? or is this standard behavior and linux does the same?

It is standard shell behavior (zsh, bash, tcsh, etc.) MacOS and Linux and other Unix OSes all use the same shells.

1 Like