Dasel
v2
v2
  • Introduction
  • GitHub
  • Supported file formats
  • Memory usage
  • Installation
  • Commands
    • Select
    • Put
    • Delete
  • Functions
    • Selector Overview
    • All
    • And
    • Append
    • Count
    • Equal
    • Filter
    • FilterOr
    • First
    • Index
    • Join
    • Key
    • Keys
    • Last
    • Len
    • LessThan
    • MapOf
    • Merge
    • MoreThan
    • Not
    • Or
    • OrDefault
    • Parent
    • Property
    • String
    • Null
    • This
    • Type
  • Examples
    • Using dasel as a go package
    • Basics
    • Change file format
    • Filtering objects based on present/missing key
Powered by GitBook
On this page
  • Usage
  • Examples
  • Append an int to a list
  • Append an int to a list with alias
Edit on GitHub
  1. Functions

Append

Append accepts no arguments.

It appends a new index to the input slice/array.

Usage

Because the append function is commonly used dasel has a recognised alias of [] that results in a append() call.

Examples

Append an int to a list

$ echo '[10, 11]' | dasel put -r json -t int -v 12 'append()'
[
  10,
  11,
  12
]

Append an int to a list with alias

$ echo '[10, 11]' | dasel put -r json -t int -v 12 '[]'
[
  10,
  11,
  12
]
PreviousAndNextCount

Last updated 2 years ago