CONVERT(1L)

πŸ“¦ version 2.4, in fedora 43, fedora 44

✨ CONVERT πŸ’…

okay bestie, gather round, because we're talking about convert β€” the manual page for it lives in section 1L of the manual, and it is literally the glow-up artist for your ancient scripts. no cap.


🌸 NAME 🌸

convert β€” convert GENESIS 1.x scripts to GENESIS 2.x syntax and command names

like. it takes your crusty old GENESIS 1.x script and gives it the GENESIS 2.x makeover. new syntax, new command names, same brain. slay.


πŸŽ€ SYNOPSIS πŸŽ€

convert [ oldscriptfile [ newscriptfile ] ] [ -noX1compat ] [ -constants
scriptfile ...  ]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea. convert converts a GENESIS 1.x script file to GENESIS 2.x syntax, replacing old command names and arguments with their GENESIS 2.x counterparts. glow-up complete. πŸ’–

the vibe check on where it reads and writes:

  • with no arguments? convert reads from standard input and writes to standard output. very demure, very pipes-and-redirection.
  • with arguments? it reads from and writes to the given file names.
  • if the newscriptfile argument is not given, convert outputs to a file with the same name as the input file, minus any directory path.
  • if a directory path is not given for the input file, output is written to standard output.

🧚 converting a whole script set (the iconic move) 🧚

to convert entire script sets, UNIX command shell loops may be used. assuming an old set of scripts lives in the directory ../oldscripts, then the following will convert the entire script set.

for csh:

foreach file (../oldscripts/*.g)
    convert $file
end

for sh:

for file in ../oldscripts/*.g
do
    convert $file
done

group chat energy: one loop and the whole folder ate. πŸ”₯


πŸ’… OPTIONS πŸ’…

  • -constants β€” bestie, to correctly translate a script, convert needs to know the names of globally defined variables in a script set. the -constants option is used to identify the scripts in which these global script variables are defined. more than one script may be specified.
  • -noX1compat β€” the automatic translation of create commands for Xodus objects to objects in the X1compat library may be suppressed using the -noX1compat option. in this case, converted scripts will use the Xodus 2 objects directly. this will work most of the time for the standard Xodus 1 interface objects, but will likely fail for the draw widgets and pixes. xgraph widgets may also fail when not using X1compat, but have a better chance of working than xdraw et al.
ngl, if you're reaching for -noX1compat just know the odds are not in your favor for the draw widgets and pixes. 😭

🌈 SEE ALSO 🌈

the GENESIS 1.x to GENESIS 2.x conversion section of the GENESIS Reference Manual. iykyk, go read it. πŸ“–


πŸ’€ BUGS πŸ’€

okay this is the part where we hold hands, because there's some real stuff here.

  • convert is not a complete conversion solution. see the Doc/convert.doc help file for a complete discussion of conversion issues, including a list of problem areas.
🚨 MAJOR ONE, READ THIS TWICE 🚨 convert will delete the contents of the input file if the output filename is the same as the input file name. this can be done implicitly if the input filename path refers to a file in the current directory using a relative path (e.g. convert ./file.g). not me accidentally vaporizing my own script. πŸ’€ back up your files, bestie, fr fr.
  • convert makes use of the X1compat script set for compatibility with GENESIS 1.x graphical interface elements. the X1compat script directory should be added to the SIMPATH, and the X1compat script called from the .simrc or the main simulation script.
  • convert translates network models using GENESIS 1.x connections to commands in the connection compatibility library. this library is not included by default in the GENESIS 2.x executable. see the GENESIS Reference Manual for details on compiling GENESIS 2.x with the connection compatibility library, and for tips on rewriting network simulations using the new network modeling objects and commands.

and that's the whole page, periodt. πŸ’œ this one's dated 3 October 1994 and it's the CONVERT(1L) manual page β€” yes, 1994, the manpage is older than most of us and still handing out glow-ups. take care of your scripts out there. 🫢✨

πŸ“¦ where this page comes from