Re: Comment before 'else' on CLI, does not save to history correctly

2019-07-25 Thread Chet Ramey
On 7/23/19 9:16 PM, Anthony Thyssen wrote: > OS: Fedora 28, Running on a Dell Latitude E7450 > Standard RPM Package: bash-4.4.23-1.fc28.x86_64 > > > if you type a multi-line if-then-else-fi statement with a command before the > else. > Bash does not add a semi-colon before the else when savi

Re: comment on RFE: 'shift'' [N] ARRAYNAME

2018-09-27 Thread L A Walsh
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

Re: comment on RFE: 'shift'' [N] ARRAYNAME

2018-09-27 Thread L A Walsh
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

Re: comment on RFE: 'shift'' [N] ARRAYNAME

2018-09-27 Thread Greg Wooledge
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.

Re: comment on RFE: 'shift'' [N] ARRAYNAME

2018-09-27 Thread Ilkka Virta
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

Re: comment on RFE: 'shift'' [N] ARRAYNAME

2018-09-27 Thread Chet Ramey
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

Re: comment on RFE: 'shift'' [N] ARRAYNAME

2018-09-27 Thread Dennis Williamson
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

Re: comment on RFE: 'shift'' [N] ARRAYNAME

2018-09-27 Thread Greg Wooledge
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

Re: comment

2006-04-09 Thread Mike Stroyan
> I have a question for you. > How to comment a paragraph in bash file ? > I read a lot of documentation and I dont find anything. May be I miss > It but i need to know. There isn't a special convention for a paragraph comment. You can start each line in your paragraph with a '#' character. That