bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: feature request: allow shif [n] with n > $#


From: Greg Wooledge
Subject: Re: feature request: allow shif [n] with n > $#
Date: Mon, 15 Apr 2019 08:42:53 -0400
User-agent: Mutt/1.10.1 (2018-07-13)

On Sat, Apr 13, 2019 at 09:43:47AM +0200, Toralf Förster wrote:
> Except, that I used the opposite:
> 
>       min_days=${1:-5}
>       min_hours=${2:-12}
>       min_compl=${3:-3500}
>       shift "$(( $# < 3 ? $# : 3 ))"
>       setupargs="$@"

So... this user interface of yours.  It looks something like

  myprog [days] [hours] [compl] [file ...]

So if the user passes two numeric arguments and then a filename, the
third filename becomes "compl" (whatever that is, but it seems to be
numeric)?

If the user passes two numeric arguments and then 17 filenames, the
first filename becomes "compl" and gets shifted away, and then only
the last 16 filenames are processed?

I'm seeing a whole lot of pitfall here and not much safety net.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]