Shell.CloseInput
----------------

Closes input stream.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Shell](component_Shell.md) | [8.3](newinversion83.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |

MBS( "Shell.CloseInput"; ShellRef ) 

**MBS**( **"Shell.CloseInput";** /\* Closes input stream. \*/  
**$ShellRef**) /\* The reference number from the shell.e.g. $shell \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ShellRef | The reference number from the shell. | $shell |

### Result

Returns OK or error.

### Description

Closes input stream.  
If needed, you can close the input stream after writing to it to signal end of file to the application.  
### Examples

Run a command line tool with input:

 Set Variable \[ $shell ; Value: MBS ( "[Shell.New](ShellNew.md)" ) \]   
Set Variable \[ $s ; Value: MBS ( "[Shell.Execute](ShellExecute.md)"; $shell ; "/Applications/Postgres.app/Contents/Versions/15/bin/gdaltransform"; "-s\_srs"; "EPSG:25832"; "-t\_srs"; "EPSG:4326"; "-output\_xy") \]   
\# send input data and close input   
Set Variable \[ $s ; Value: MBS ( "[Shell.WriteInputText](ShellWriteInputText.md)"; $shell ; "666862 6716190"; "UTF-8") \]   
Set Variable \[ $s ; Value: MBS ( "Shell.CloseInput"; $shell ) \]   
\# wait for app to finish   
Set Variable \[ $s ; Value: MBS ( "[Shell.Wait](ShellWait.md)"; $shell ; 5) \]   
\# read results   
Set Variable \[ $error ; Value: MBS ( "[Shell.ReadErrorText](ShellReadErrorText.md)"; $shell ; "UTF-8") \]   
Set Variable \[ $result ; Value: MBS ( "[Shell.ReadOutputText](ShellReadOutputText.md)"; $shell ; "UTF-8") \]   
Set Field \[ Shell::Error ; MBS ( "[Text.ReplaceNewLine](TextReplaceNewLine.md)"; $error ; 1) \]   
Set Field \[ Shell::Output ; MBS ( "[Text.ReplaceNewLine](TextReplaceNewLine.md)"; $result ; 1) \]   
Set Variable \[ $r ; Value: MBS ("[Shell.Release](ShellRelease.md)"; $shell ) \]  
### See also

- [Shell.Execute](ShellExecute.md)
- [Shell.New](ShellNew.md)
- [Shell.ReadErrorText](ShellReadErrorText.md)
- [Shell.ReadOutputText](ShellReadOutputText.md)
- [Shell.Release](ShellRelease.md)
- [Shell.Wait](ShellWait.md)
- [Shell.WriteInputText](ShellWriteInputText.md)
- [Text.ReplaceNewLine](TextReplaceNewLine.md)

### Release notes

- **Version 8.3**
    - Added [Shell.CloseInput](http://www.mbsplugins.eu/ShellCloseInput.shtml) and [Shell.CloseStreams](http://www.mbsplugins.eu/ShellCloseStreams.shtml) functions.

### Blog Entries

- [MBS FileMaker Plugin, version 8.3pr3](https://www.mbsplugins.de/archive/2018-06-21/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th June 2018 , last changed 30th January 2023

  
[Shell.ClearEnvironment](ShellClearEnvironment.md) - [Shell.CloseStreams](ShellCloseStreams.md)

[HTML Version](ShellCloseInput.shtml)