# server.Server.ifShell

- **Module:** server.Server
- **Package:** @libtmux/libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/2cb93308200da38a26b59876618116850f110607/packages/libtmux/src/server.ts#L922
- **Page:** https://libtmux.org/reference/ts/server-server-ifshell/

```
server.Server.ifShell(condition: : string, command: : string, options: : IfShellOptions) -> Promise<void>
```

Run one command or another depending on a condition.

## Example

```ts
await server.ifShell("test -d /tmp", "display-message 'present'");
```
