---
name: "jx_repl"
section: "1"
platform: "linux"
package: "coop-computing-tools"
version: "1:7.14.5-1+b2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/jx_repl"
---

# jx\_repl(1)

interactive command line tool to explore the JX expression language.

## NAME

**jx\_repl** - interactive command line tool to explore the JX expression language.

## SYNOPSIS

FCjx\_replFT

## DESCRIPTION

**jx\_repl** is an interactive tool to explore the JX expression language.  **jx\_repl** will read in a JX expression, evaluate it, print the result, then save both the query and the result to the context.  Results of previous expressions can be referenced via the out\_%d\` symbol, and their corresponding query via the \`in\_%d\` symbol.  The program will exit on EOF or when the user enters 'quit' or 'exit.

**jx\_repl** also reserves certain symbols in the context to act as commands when entered:

- •

  **help** display a help message which lists details on reserved commands.

- •

  **functions** display a list of functions supported by JX.

- •

  **values** display a list of values supported by JX.

- •

  **operators** display a list of operators supported by JX.

- •

  **catalog** fetch the catalog data.

- •

  **exit** exit the program.

- •

  **quit** same as 'exit'.

## EXIT STATUS

Will always return 0

## EXAMPLES

Simply run **jx\_repl** with no parameters:

```

```

-

  % jx\_repl Welcome to the JX Language Explorer.

  Type 'help' for help

  in\_0 :

Enter any valid JX expression:

```

```

-

  % jx\_repl in\_0  : \[ "file" + x + ".txt" for x in range(3) \] out\_0 : \[\
     "file0.txt",\
     "file1.txt",\
     "file2.txt" \]

Fetch the catalog data:

```

```

-

  % jx\_repl in\_1  : catalog out\_1 : \[\
     {\
       "name":NAME,\
       "lastheardfrom":1620308581,\
       "address":ADDRESS,\
       ...\
       "type":"wq\_factory"\
     },

    ... \]

Perform operations on previous output

```

```

-

  % jx\_repl in\_2  : select(out\_1, type=="wq\_master") out\_2 : \[

    {\
       "name":NAME,\
       "lastheardfrom":1620308755,\
       "address":ADDRESS,\
       "tasks\_total\_disk":0,\
       "tasks\_total\_memory":0,\
       ...\
       "type": wq\_master\
     }\
     ... \]

Do more operations on previous output

```

```

-

  % jx\_repl in\_3  : join(project(out\_2, name), ", ") out\_3 : NAME\_1, NAME\_2, NAME\_3, ..., NAME\_N

Now, fetch the query used to attain that output

```

```

-

  % jx\_repl in\_4  : in\_4 out\_4 : join(project(select(fetch("http://catalog.cse.nd.edu:9097/query.json"),type=="wq\_master"),name),", ")

Call one of reserved commands

```

```

-

  % jx\_repl in\_5  : help

    help          display this message\
     functions     display a list of functions supported by the JX language\
     values        display a list of values supported by the JX language\
     operators     display a list of operators supported by the JX language\
     in\_#          the #'th input query\
     out\_#         result of in\_#\
     catalog       alias to fetch catalog data\
     quit\|exit     exit program

## COPYRIGHT

The Cooperative Computing Tools are Copyright (C) 2022 The University of Notre Dame.  This software is distributed under the GNU General Public License.  See the file COPYING for details.
