On Fri, Jul 10, 2020 at 10:14:38AM +0100, Chris Elvidge wrote:
> export PS1='\[${fcol[d]}${ecol[!!$?]}\][$?] \[${ucol[!!$(id
> -u)]}\]\h\[${fcol[b]}\]!\[${ucol[!!$(id -u)]}\]\u\[${fcol[w]}\]:(`tty|cut
> -d/ -f3-`):\D{%a %d %b %Y %I:%M %P %Z}:`pwd`\n\$\[${fcol[n]}\] '
>
> I somehow thought that [..
On 7/10/20 5:14 AM, Chris Elvidge wrote:
> Are the two uses (array subscript and arithmetic context) of [...]
> connected/related? Or am I (stupidly) seeing a connection where none really
> exists?
No doubt they resemble each other, since the bounding characters are the
same and the contents are
On 05/07/2020 06:24 pm, Chet Ramey wrote:
On 7/4/20 12:23 PM, Lawrence Velázquez wrote:
Quoting Chet liberally from
https://lists.gnu.org/archive/html/bug-bash/2012-04/msg00034.html:
It dates from Posix circa 1990 (1003.2d9, of which I've lost my paper
copy). I implemented it after the Ber
On 06/07/2020 12:50 pm, Greg Wooledge wrote:
On Fri, Jul 03, 2020 at 07:00:54PM +0100, Chris Elvidge wrote:
I've used 'return $((!$#))' and 'return $[!$#]' to return an error if no
parameters given to function.
The problem with this is that it *always* returns from the function,
even when para
On Fri, Jul 03, 2020 at 07:00:54PM +0100, Chris Elvidge wrote:
> I've used 'return $((!$#))' and 'return $[!$#]' to return an error if no
> parameters given to function.
The problem with this is that it *always* returns from the function,
even when paramters are given.
If you actually want to do
On 7/4/20 12:23 PM, Lawrence Velázquez wrote:
> Quoting Chet liberally from
> https://lists.gnu.org/archive/html/bug-bash/2012-04/msg00034.html:
>>
>> It dates from Posix circa 1990 (1003.2d9, of which I've lost my paper
>> copy). I implemented it after the Berkeley guys, mostly Marc
>> Teitelba
On 7/4/20 7:54 AM, Chris Elvidge wrote:
> On 03/07/2020 11:16 pm, Eli Schwartz wrote:
>> On 7/3/20 2:00 PM, Chris Elvidge wrote:
>>> I've used 'return $((!$#))' and 'return $[!$#]' to return an error if no
>>> parameters given to function.
>>>
>>> Tested in a bash script 'exit $((!$#)) / $[!$#]' -
> On Jul 4, 2020, at 8:12 AM, pepa65 wrote:
>
> On 04/07/2020 04.39, Lawrence Velázquez wrote:
>> It might tell you something that $[...] is not even mentioned in
>> the man page for bash 3.2.57, which is decidedly not the current
>> version.
>
> About that, is it for sure that $[] is going to b
On 03/07/2020 11:16 pm, Eli Schwartz wrote:
On 7/3/20 2:00 PM, Chris Elvidge wrote:
I've used 'return $((!$#))' and 'return $[!$#]' to return an error if no
parameters given to function.
Tested in a bash script 'exit $((!$#)) / $[!$#]' - both work.
'echo $((!$#)) / $[!$#]' - both echo 1 when
On 03/07/2020 10:39 pm, Lawrence Velázquez wrote:
On Jul 3, 2020, at 2:00 PM, Chris Elvidge wrote:
However 'N=0; echo $((!$N))' gives an error at the bash prompt.
'echo $[!$N]' echo's 1 as expected.
My question - is $[...] actually obsolete?
It might tell you something that $[...] is not eve
4 Temmuz 2020 Cumartesi tarihinde pepa65 yazdı:
> On 04/07/2020 04.39, Lawrence Velázquez wrote:
> > It might tell you something that $[...] is not even mentioned in
> > the man page for bash 3.2.57, which is decidedly not the current
> > version.
>
> About that, is it for sure that $[] is going
On 04/07/2020 04.39, Lawrence Velázquez wrote:
> It might tell you something that $[...] is not even mentioned in
> the man page for bash 3.2.57, which is decidedly not the current
> version.
About that, is it for sure that $[] is going to be obsoleted/removed in
the future? I happened to use it r
On 03/07/2020 11:16 pm, Eli Schwartz wrote:
On 7/3/20 2:00 PM, Chris Elvidge wrote:
I've used 'return $((!$#))' and 'return $[!$#]' to return an error if no
parameters given to function.
Tested in a bash script 'exit $((!$#)) / $[!$#]' - both work.
'echo $((!$#)) / $[!$#]' - both echo 1 when
On 03/07/2020 10:39 pm, Lawrence Velázquez wrote:
On Jul 3, 2020, at 2:00 PM, Chris Elvidge wrote:
However 'N=0; echo $((!$N))' gives an error at the bash prompt.
'echo $[!$N]' echo's 1 as expected.
My question - is $[...] actually obsolete?
It might tell you something that $[...] is not
On 7/3/20 2:00 PM, Chris Elvidge wrote:
> I've used 'return $((!$#))' and 'return $[!$#]' to return an error if no
> parameters given to function.
>
> Tested in a bash script 'exit $((!$#)) / $[!$#]' - both work.
>
> 'echo $((!$#)) / $[!$#]' - both echo 1 when no params, 0 when any
> number of p
> On Jul 3, 2020, at 2:00 PM, Chris Elvidge wrote:
>
> However 'N=0; echo $((!$N))' gives an error at the bash prompt.
> 'echo $[!$N]' echo's 1 as expected.
>
> My question - is $[...] actually obsolete?
It might tell you something that $[...] is not even mentioned in
the man page for bash 3.2.
I've used 'return $((!$#))' and 'return $[!$#]' to return an error if no
parameters given to function.
Tested in a bash script 'exit $((!$#)) / $[!$#]' - both work.
'echo $((!$#)) / $[!$#]' - both echo 1 when no params, 0 when any
number of params.
I'm told ( https://wiki.bash-hackers.org/s
17 matches
Mail list logo