Answers.Body: <p>The <a href="https://www.gnu.org/software/xboard/manual/xboard.txt" rel="nofollow noreferrer">manual</a> seems to suggest you can use <code>-lgf</code> followed by the name of a PGN file:</p>
  <pre><code>4.5 Load and Save options
  =========================
  
  -lgf or -loadGameFile file
  -lgi or -loadGameIndex index
       If the `loadGameFile' option is set, XBoard loads the specified
       game file at startup. The file name `-' specifies the standard
       input. If there is more than one game in the file, XBoard pops up
       a menu of the available games, with entries based on their PGN
       (Portable Game Notation) tags.  If the `loadGameIndex' option is
       set to `N', the menu is suppressed and the N th game found in the
       file is loaded immediately.  The menu is also suppressed if
       `matchMode' is enabled or if the game file is a pipe; in these
       cases the first game in the file is loaded immediately.  Use the
       `pxboard' shell script provided with XBoard if you want to pipe in
       files containing multiple games and still see the menu.  If the
       loadGameIndex specifies an index -1, this triggers auto-increment
       of the index in `matchMode', which means that after every game the
       index is incremented by one, causing each game of the match to be
       played from the next game in the file. Similarly, specifying an
       index value of -2 causes the index to be incremented every two
       games, so that each game in the file is used twice (with reversed
       colors).  The `rewindIndex' option causes the index to be reset to
       the first game of the file when it has reached a specified value.
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-20T16:19:30.907Z
Answers.LastActivityDate: 2022-01-20T16:19:30.907Z
Answers.UserDisplayName: Glorfindel
Body: <p>Is it possible to import a game into XBoard from the command line?
  I am unable to find anything on it on the XBoard website or the XBoard man page, although I may have missed something.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-01-20T16:26:15.323Z
Comments.Text: At least for me on Linux simply `xboard game.pgn` does it. Is this not what you want?
Comments.UserDisplayName: Ian Bush
Tags: <software>
Title: How to import a game into XBoard from the command line
ThreadText: # How to import a game into XBoard from the command line
  
  (Asked by: username_0 on 2022-01-20)
  
  Is it possible to import a game into XBoard from the command line?
  I am unable to find anything on it on the XBoard website or the XBoard man page, although I may have missed something.
  
  **Tags:** software
  
  > **Comments:**
  > **username_1**: At least for me on Linux simply `xboard game.pgn` does it. Is this not what you want?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2022-01-20. Score: 3 | Accepted answer
  
  The [manual](https://www.gnu.org/software/xboard/manual/xboard.txt) seems to suggest you can use `-lgf` followed by the name of a PGN file:
  
  ```
  4.5 Load and Save options
  =========================
  
  -lgf or -loadGameFile file
  -lgi or -loadGameIndex index
       If the `loadGameFile' option is set, XBoard loads the specified
       game file at startup. The file name `-' specifies the standard
       input. If there is more than one game in the file, XBoard pops up
       a menu of the available games, with entries based on their PGN
       (Portable Game Notation) tags.  If the `loadGameIndex' option is
       set to `N', the menu is suppressed and the N th game found in the
       file is loaded immediately.  The menu is also suppressed if
       `matchMode' is enabled or if the game file is a pipe; in these
       cases the first game in the file is loaded immediately.  Use the
       `pxboard' shell script provided with XBoard if you want to pipe in
       files containing multiple games and still see the menu.  If the
       loadGameIndex specifies an index -1, this triggers auto-increment
       of the index in `matchMode', which means that after every game the
       index is incremented by one, causing each game of the match to be
       played from the next game in the file. Similarly, specifying an
       index value of -2 causes the index to be incremented every two
       games, so that each game in the file is used twice (with reversed
       colors).  The `rewindIndex' option causes the index to be reset to
       the first game of the file when it has reached a specified value.
  
  ```
  
  
  ---
  
  