File: jo.25.sh

package info (click to toggle)
jo 1.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 612 kB
  • sloc: ansic: 1,914; sh: 566; makefile: 60; exp: 42
file content (14 lines) | stat: -rw-r--r-- 473 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# overwrite values of existing object keys

${JO:-jo} a=1 b=2 a=3
${JO:-jo} -D a=1 b=2 a=3

tmp=`${JO:-jo} 1=a 2=b 3=c`
${JO:-jo} -d . stage="$tmp" down=up stage.2=x stage\[3\]=y stage.4=d stage\[1\]=h
${JO:-jo} -D -d . stage="$tmp" down=up stage.2=x stage\[3\]=y stage.4=d stage\[1\]=h

# dedup filter input too
tmpf=$$.json
trap 'rm -f "$tmpf"' 0 1 2 15
${JO:-jo} name=aaa name=aaa | tee $tmpf | ${JO:-jo} -D -f - name=aaa
${JO:-jo} -D -f $tmpf another_name=abc name=cba