# unix command

The unix command invokes the sh command, to push a shell, and then automatically returns
to D3 on completion.

To return to D3, type exit at the
UNIX prompt.

The user can specify an optional command string
to the unix command. This command string can include
the D3 file and item pairs, which interacts with the specified unix command exactly as if those parameters were UNIX files.
Any changes made to the specified parameters by the unix command is also reflected in the D3 items after the command has
completed.

During the substitution of D3 items for UNIX files,
attribute marks are converted to new lines and groups of four spaces
are converted to tabs. When items are brought back from the unix command, these conversions are reversed.

Options
can be placed after a dash as the first argument on the command line
or can be put into attribute 6 of the unix master dictionary item.

## Syntax

```
unix {-options} {unix.cmd} {{D3.file D3.item}}
```

## Parameter(s)

| {-options} | Indicates the number of spaces that represent a tab. |
| --- | --- |
| c | Does not convert attribute marks to new lines and vice-versa. |
| i | Uses item name as an export tag. This is useful when a UNIX based word-processing package is used and it is desirable that the filename eventually passed to that package be related to the original D3 item name. |
| n | Does not convert tabs. |
| v | Converts value marks to new lines. Note: The conversion cannot be undone and value marks will be lost once the process is completed. |

## Example(s)

Creates a list of all misspelled
words existing in the D3 item stock.report and places that list into
an item called sp in the pointer-file.

```
UNIX spell {ba,doc, stock.report} >
{dm,pointer-file, sp}
```
Allows editing the my.prog item with the emacs editor.
After exiting emacs, any modifications to data is updated in my.prog.

```
unix -2 emacs {bp my.prog}
```

## See also

- [VI editor quick reference commands](https://d3codex.com/unix/vi-quick-reference/)

---
Source: https://d3codex.com/tcl/unix-command/ - part of the D3Codex reference.
