On Tue, Sep 25, 2018 at 05:17:27PM -0700, L A Walsh wrote:
> It struck me as it might be convenient if 'shift' could take an optional
> arrayname as an argument. Would that be possible or would it cause some
> incompatibility?
The biggest issue here is how you specify the arguments.
Shift alread
On Tue, Sep 25, 2018, 7:17 PM L A Walsh wrote:
> It struck me as it might be convenient if 'shift' could take an optional
> arrayname as an argument. Would that be possible or would it cause some
> incompatibility?
>
> i.e.
>
> > set one two three four five
> > dcl -a ARGV=("$@")
> > shift AR
On 9/27/18 8:42 AM, Dennis Williamson wrote:
> array_shift=2
> arr=("${arr[@]:$array_shift}")
>
> Done.
This is the simplest and most elegant solution.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CW
On 27.9. 15:35, Greg Wooledge wrote:
Shift already takes one optional argument: the number of items to shift
from the argv list. Adding a second optional argument leads to a quagmire.
Do you put the optional list name first, or do you put the optional number
first? If only one argument is given
On Thu, Sep 27, 2018 at 06:47:33PM +0300, Ilkka Virta wrote:
> Can you make an array whose name even starts with a digit?
No, that's also disallowed. Bash variable names (including arrays) must
begin with a letter or underscore.
On 9/27/2018 5:42 AM, Dennis Williamson wrote:
[include stdalias]
#[include Types] #if type-checking include Types+line below
lshift () {
(($#)) || return 1
int nshift=1
if [[ $1 =~ ^[0-9]+$ ]]; then nshift=$1; shift;fi
#if ! isArr $1; then echo >&2 "Need arrayname"; return 1; fi
m
On 9/27/2018 5:35 AM, Greg Wooledge wrote:
On Tue, Sep 25, 2018 at 05:17:27PM -0700, L A Walsh wrote:
It struck me as it might be convenient if 'shift' could take an optional
arrayname as an argument. Would that be possible or would it cause some
incompatibility?
The biggest issue
Hi. Why is this function closing out my session if typed on the terminal?
Same thing in a shell script.
On 28/09/2018, Francis Gathea wrote:
> Hi. Why is this function closing out my session if typed on the terminal?
>