Re: Array not defined when being set inline

2017-10-10 Thread shawn wilson
On Tue, Oct 10, 2017 at 8:21 AM, Greg Wooledge wrote: > On Tue, Oct 10, 2017 at 08:00:58AM -0400, shawn wilson wrote: >> I guess that's the right way to describe what I'm seeing: >> >> [swilson@localhost ~]$ unset f; f=(aaa bbb ccc) declare -p f >> declare

Array not defined when being set inline

2017-10-10 Thread shawn wilson
I guess that's the right way to describe what I'm seeing: [swilson@localhost ~]$ unset f; f=(aaa bbb ccc) declare -p f declare -x f="(aaa bbb ccc)" [swilson@localhost ~]$ unset f; f=("aaa" "bbb" "ccc") declare -p f declare -x f="(aaa bbb ccc)" [swilson@localhost ~]$ unset f; f=(aaa bbb ccc) [swils

Re: scripts one after the other

2016-03-26 Thread shawn wilson
On Sat, Mar 26, 2016 at 9:26 AM, Val Krem wrote: > > I'm not sure what you want, but you could always pipe one script into > another and evaluate the input from the later. Or just call the second > script from the first in an if. > (untested) #!/bin/bash # t2.sh read f if [[ $f == foo ]] ; then

Re: scripts one after the other

2016-03-26 Thread shawn wilson
On Mar 25, 2016 9:32 PM, "Val Krem" wrote: > > At the present I have defined the variables and folders path in both scripts. > > Instead of this, is it possible to combine the two scripts in one so that I can define the varietals at one spot. It would be less prone to error. > What I've done i

bug with getting an array index or ...

2015-12-06 Thread shawn wilson
declare -a array=( ); echo "${!array[@]}"; echo "${!array[@]:-}" also, "${!array[@]:foo}" and :+foo and :-foo are all empty as well - I'm pretty sure this is not intended?

Re: unset does not act as expected on namerefs

2015-06-02 Thread Shawn Wilson
On +2015/06/02 08:31:57, Greg Wooledge wrote: > > > Also, whatever happens, I think there should also be a way to test > > for variable type (either another test flag or something like perl's > > ref() ). > > Bash is not a strongly typed language. You've got strings, and indexed > arrays, and a

Re: unset does not act as expected on namerefs

2015-06-01 Thread Shawn Wilson
Top posting as I'm kinda going out of band of the thread here; Having read the discussion, I guess the issue I brought up really isn't a "bug" (though Greg's points probably should be considered bugs). I'll preface this by saying I'm not an expert in bash by any means. However, most languages have

Re: unset does not act as expected on namerefs

2015-05-26 Thread Shawn Wilson
On +2015/05/26 18:05:18, Geir Hauge wrote: > On Tue, May 26, 2015 at 11:00:45AM -0500, Eduardo A. Bustamante López wrote: > > # Here we 'unset ref', which actually unsets 'var'. Then, we assign 'var' to > > # 'ref', but since 'ref' is still a nameref, it instead assigns 'var' to > > 'var'. > > dua

Re: unset does not act as expected on namerefs

2015-05-26 Thread Shawn Wilson
On +2015/05/26 11:04:38, Greg Wooledge wrote: > On Tue, May 26, 2015 at 10:31:34AM -0400, Shawn Wilson wrote: > > swilson@swlap1:~/temp$ bash --version > > GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu) > > swilson@swlap1:~/temp$ cat t.txt > > $ome text !n

unset does not act as expected on namerefs

2015-05-26 Thread Shawn Wilson
swilson@swlap1:~/temp$ bash --version GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu) swilson@swlap1:~/temp$ cat t.txt $ome text !n a file| swilson@swlap1:~/temp$ unset t swilson@swlap1:~/temp$ t=$(< ./t.txt) swilson@swlap1:~/temp$ echo "$t" bash: $ome text !n a file|: invalid variable n