Re: [PATCH] fc: trim range instead of erroring out

2020-08-20 Thread Chet Ramey
On 8/20/20 9:08 AM, Martijn Dekker wrote: > Op 12-08-20 om 16:40 schreef Chet Ramey: >> What's your opinion about what the `as appropriate' means? An out-of-range >> `first' gets substituted with the first command in the history, and an out- >> of-range `last' gets the last history entry? > > Yes,

Re: [PATCH] fc: trim range instead of erroring out

2020-08-20 Thread Martijn Dekker
Op 12-08-20 om 16:40 schreef Chet Ramey: What's your opinion about what the `as appropriate' means? An out-of-range `first' gets substituted with the first command in the history, and an out- of-range `last' gets the last history entry? Yes, that was my intention. Bash does one thing, your p

Re: [PATCH] fc: trim range instead of erroring out

2020-08-12 Thread Chet Ramey
On 8/11/20 11:59 AM, Martijn Dekker wrote: > This is different from every other shell, and also looks like it's contrary > to the POSIX spec: > https://pubs.opengroup.org/onlinepubs/9699919799/utilities/fc.html#tag_20_44_05 > > | When a range of commands is used, it shall not be an error to speci

Re: [PATCH] fc: trim range instead of erroring out

2020-08-11 Thread Chet Ramey
On 8/11/20 11:59 AM, Martijn Dekker wrote: > As I use/try/test many shells, I'm in the habit of using POSIX commands > such as 'fc -l 1' to list the complete history. > > If there have been more than $HISTSIZE command, the list is trimmed at the > beginning without renumbering, and bash errors out