Posts in 2021

Posts in 2020

  • Sed

    Saturday, October 31, 2020 in Shell

    SED: Delete lines from file (delete command) Description Command Input Output Delete the line 2 and 5from the file my.txt sed -e '2d' -e '5d' my.txt Or sed -e '2d;5d' my.txt line - one line - two line - three line - four line - five line - six line - …

    Read more

Posts in 2019

  • Extract Data From Json String

    Tuesday, January 08, 2019 in Shell

    myjson='{"somekey":"someval"}' v=`echo $myjson | jq '.somekey'` echo $v output: "someval" # Get the value wihout quotes v=`echo $myjson | jq -r '.somekey'` echo $v output: someval

    Read more