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
  • Example
  • Function usage
  • Alias usage
Edit on GitHub
  1. Functions

Index

Index expect 1 argument.

It can be used with a list, and returns the value at the given index list.

Usage

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

Example

Function usage

$ echo '["a","b","c"]' | dasel -r json 'index(1)'
"b"

Alias usage

$ echo '["a","b","c"]' | dasel -r json '[1]'
"b"
PreviousFirstNextJoin

Last updated 2 years ago