[Install](https://docs.puppet.com/puppet/latest/modules_installing.html) the stdlib module to add the functions, facts, and resources of this standard library to Puppet.
Ifyouareauthoringamodulethatdependsonstdlib,besureto[specifydependencies](https://docs.puppet.com/puppet/latest/modules_metadata.html#specifying-dependencies) in your metadata.json.
FileswithspecialcharactersthatarenotvalidUTF-8givetheerrormessage"Invalid byte sequence in UTF-8".Inthiscase,determinethecorrectfileencodingandspecifyitwiththe`encoding`attribute.
>DEPRECATED:Thisfunctionhasbeenreplacedwithabuilt-in[`dig`](https://docs.puppet.com/puppet/latest/function.html#dig) function as of Puppet 4.5.0. Use [`dig44()`](#dig44) for backwards compatibility or use the new version.
Builds a command line string from a given array of strings. Each array item is escaped for Bourne shell. All items are then joined together, with a single space in between. This function behaves the same as Ruby's `Shellwords.shelljoin()` function; see the [Ruby documentation](http://ruby-doc.org/stdlib-2.3.0/libdoc/shellwords/rdoc/Shellwords.html#method-c-shelljoin).
For example:
```puppet
shell_join(['foo bar', 'ba"z'])=>'foo\barba\"z'
```
*Type*: rvalue.
#### `shell_split`
Splits a string into an array of tokens. This function behaves the same as Ruby's `Shellwords.shellsplit()` function; see the [ruby documentation](http://ruby-doc.org/stdlib-2.3.0/libdoc/shellwords/rdoc/Shellwords.html#method-c-shellsplit).
*Example:*
```puppet
shell_split('foo\ bar ba\"z') => ['foo bar', 'ba"z']
Arguments:Astringspecifyingthetimein`strftime`format.SeetheRuby[strftime](https://ruby-doc.org/core-2.1.9/Time.html#method-i-strftime) documentation for details.
Thisfunctionisprovidedforbackwardscompatibility,butthebuilt-in[type()function](https://docs.puppet.com/puppet/latest/reference/function.html#type) provided by Puppet is preferred.
Puppet4allowsimproveddefinedtypecheckingusing[datatypes](https://docs.puppet.com/puppet/latest/reference/lang_data.html). Data types avoid some of the problems with Puppet 3's `validate_*` functions, which were sometimes inconsistent. For example, [validate_numeric](#validate_numeric) unintentionally allowed not only numbers, but also arrays of numbers or strings that looked like numbers.
MovingtoPuppet4typevalidationallowsmuchbetterdefinedtypecheckingusing[datatypes](https://docs.puppet.com/puppet/latest/reference/lang_data.html). Many of Puppet 3's `validate_*` functions have surprising holes in their validation. For example, [validate_numeric](#validate_numeric) allows not only numbers, but also arrays of numbers or strings that look like numbers, without giving you any control over the specifics.