[Solved] How to get the sh formatter up and running?

The command is installed as $HOME/go/bin/shfmt (unless GOBIN is set, then it’s $GOBIN/shfmt): $ go help install usage: go install [-i] [build flags] [packages] Install compiles and installs the packages named by the import paths. Executables are installed in the directory named by the GOBIN environment variable, which defaults to $GOPATH/bin or $HOME/go/bin if the … Read more

[Solved] Remove newlines between two words

something like this? kent$ awk ‘/^key.:/{p=1}/^name:/{p=0} {if(p)printf “%s”,$0;else printf “%s%s\n”, (NR==1?””:RS),$0}’ file name: charles key1: howareyou? name: erika key2: I’mfine,thanks name: … handle the spaces: awk ‘/^key.:/{p=1}/^name:/{p=0} {if(p)printf “%s%s”,(/^key.:/?””:” “),$0; else printf “%s%s\n”, (NR==1?””:RS),$0}’ file output: name: charles key1: how are you? name: erika key2: I’m fine, thanks name: … 2 solved Remove newlines between … Read more