duplicated lines in usage() or help files

A plethora of command-line scripts that perform geometric transforms, blurs, sharpens, edging, noise removal, and color manipulations.
Post Reply
Posts: 50
Joined: 2017-10-10T14:14:55-07:00
Authentication code: 1151

duplicated lines in usage() or help files

Post by TedBaker »

On my machine a a few of the scripts generate duplicate lines when help is printed out:

this can be fixed by adding a -n to the sed command that generates the help output


sed >&2 -n -e '1,/^####/d; /^######/g; /^#/!q; s/^#*//; s/^ //; 4,$p' "$PROGDIR/$PROGNAME"

this affects multicrop and innercrop
User avatar
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: duplicated lines in usage() or help files

Post by fmw42 »

All my scripts have the same code. It only happens on certain Linux systems. For example not on my Mac. I have seen several variations that fix this, but some cause it to break on my Mac. So right now I have no universal solution. Furthermore, it would mean manually changing over 300 scripts. So at this time, each person will have to make modifications, if this is important. See Pointer 13 on my home page about other solutions to the same issue. I will add your solution to the list there.
Post Reply