Re: bash sockets: printf \x0a does TCP fragmentation

2018-10-12 Thread Dirk Wetter
On 11.10.18 23:35, Bob Proulx wrote: > The smallest of details can break the largest of programs. :-) > > Good to hear you have things resolved and now working for you! Thanks all for your insights and help! Cheers, Dirk

Re: bash sockets: printf \x0a does TCP fragmentation

2018-10-11 Thread Dirk Wetter
On 11.10.18 18:53, Dirk Wetter wrote: > bash 0$ exec 5<>/dev/tcp/81.169.199.25/443 > bash 0$ printf > '\x16\x03\x01\x02\x00\x01\x00\x01\xfc\x03\x03\x54\x51\x1e\x7a\xde\xad\xbe\xef\x31\x33\x07\x00\x00\x00\x00\x00\xcf\xbd\x39\x04\xcc\x16\x0b\x85\x03\x90\x9f\x77\x04\x33\xd4\xde

Re: bash sockets: printf \x0a does TCP fragmentation

2018-10-11 Thread Dirk Wetter
fragment here, other people spotted that. The fragmentation is independent on the dd options used. Also "| cat" does the same. stdbuf is not available on all platforms, especially on those who do not have a similar external printf: /usr/bin/printf "\xf5\xee\xbe\xe5&quo

Re: bash sockets: printf \x0a does TCP fragmentation

2018-09-25 Thread Dirk Wetter
On 9/25/18 2:15 PM, L A Walsh wrote: > > > On 9/24/2018 6:05 AM, Greg Wooledge wrote: >> On Sat, Sep 22, 2018 at 11:50:17AM +0200, dirk+b...@testssl.sh wrote: >>   >>> On 9/22/18 7:30 AM, Bob Proulx wrote: >>>     >>>> dirk+b...@testssl.sh w

Re: bash sockets: printf \x0a does TCP fragmentation

2018-09-25 Thread dirk+bash
On 9/25/18 3:46 PM, Chet Ramey wrote: > On 9/25/18 9:04 AM, dirk+b...@testssl.sh wrote: > >> FYI: I ended up checking with type before whether an external printf >> exists and set a variable for this and then just call this variable. >> >> env or exec: never tho

Re: bash sockets: printf \x0a does TCP fragmentation

2018-09-25 Thread dirk+bash
iable for this and then just call this variable. env or exec: never thought about it (thanks!) but as both are external commands, that would mean upon every call one additional external program. (yes, I know that there is such thing as a fs buffer). Subshells also costs resources. As this is a core function I am happy for every homeopathic dose of time I safe here :-) Cheers, Dirk

Re: bash sockets: printf \x0a does TCP fragmentation

2018-09-22 Thread dirk+bash
t do that, were the ones being blamed or we need to do really strange workarounds to avoid '\x0a' in the first 8 bytes. Dirk

Re: bash sockets: printf \x0a does TCP fragmentation

2018-09-22 Thread dirk+bash
ev/null or a pipe: > >  $ strace -etrace=write bash -c 'printf "foo\nbar\n"' > /dev/null >  write(1, "foo\n", 4)    = 4 >  write(1, "bar\n", 4)    = 4 >  +++ exited with 0 +++ Oh. But thanks anyway! coreutils in fact does it in one shot as you indicated. Dirk

Re: bash sockets: printf \x0a does TCP fragmentation

2018-09-22 Thread dirk+bash
On 9/22/18 7:30 AM, Bob Proulx wrote: > dirk+b...@testssl.sh wrote: >> we discovered a strange phenomenon in the project testssl.sh: > > You are doing something that is quite unusual. You are using a shell > script direction on a TCP socket. That isn't very common

Re: bash sockets: printf \x0a does TCP fragmentation

2018-09-22 Thread dirk+bash
On 9/22/18 1:34 AM, Chet Ramey wrote: > On 9/21/18 4:13 PM, dirk+b...@testssl.sh wrote: >> >> Hello there, >> >> we discovered a strange phenomenon in the project testssl.sh: >> >> After opening a TCP socket with a fd (here: 5), when writing to it, >>

bash sockets: printf \x0a does TCP fragmentation

2018-09-21 Thread dirk+bash
a performance penalty and other strange effects, e.g. if the first segment is really small, some devices reject the ClientHello. If there's a workaround, please let me know. (tried to add "%b" with no effect). Otherwise I believe it's a bug. Cheers, Dirk PS: Would ulimit -b help?

ABOUT-NLS links are outdated

2018-07-22 Thread dirk
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKA

misleading text in `help declare` leads to serious wrong translations (e.g. German)

2018-01-12 Thread dirk
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKA

Missing documentation of the integer range (declare -i)

2017-12-06 Thread H.-Dirk Schmitt
Checked against: GNU bash, Version 4.4.12(1)-release (x86_64-pc-linux- gnu) I carefully read the man page and find no definition of the defined range of integer variables in bash. see also: `man bash |& grep -i integer` Best Regards, H.-Dirk Schmitt

Re: parenthesised regular expressions and non-greedy operator ? - non standard bash behaviour

2017-12-04 Thread H.-Dirk Schmitt
and built. I'm > not > wild about adding a dependency on pcre, or a configure test for it, > just > to have two varieties of regular expressions available. > > Chet O.k. – so close this as „not a bug“. -- Signature H.-Dirk Schmitt H.-Dirk Sch

Re: parenthesised regular expressions and non-greedy operator ? - non standard bash behaviour

2017-12-04 Thread H.-Dirk Schmitt
tion to enable the 'non-greedy' operator in a future release. So please feel free to change the „bug report“ to a „feature request“ ;-) Best Regards, H.-Dirk Schmitt On So, 2017-12-03 at 15:23 -0500, Chet Ramey wrote: > On 12/1/17 12:40 PM, d...@computer42.org wrote: > &g

parenthesised regular expressions and non-greedy operator ? - non standard bash behaviour

2017-12-01 Thread dirk
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKA

Re: Reading mysql data stream into array

2011-05-06 Thread Dirk
Am 06.05.11 18:12, schrieb DJ Mills: On Fri, May 6, 2011 at 12:07 PM, Dirk wrote: Hi folks, I am going nuts trying to read the output of a mysql select statement into an array. I have consulted bashfaq and other sources and tried various approaches, but every jump was somewhat short, it

Reading mysql data stream into array

2011-05-06 Thread Dirk
$(($i+1)) ... do messag[$i]=$line && i=$(($i+1)) It never results in every line of the mysql output becoming an array element. I really tried finding out myself, but I am stuck, so please can someone point me to what I do wrong? Thanks in advance, Dirk

i/o redirection into variables

2006-03-28 Thread Dirk H. Schulz
Hi folks, I am looking for a possiblity to redirect error output into a variable: Instead of redirecting to a file ( e.g. command 2>>errorlogfile ) I would like to redirect into a variable. Is this generally possible? Dirk ___ Bu

Line numbering in error messages

2006-03-27 Thread Dirk H. Schulz
Hi folks, I wonder if there is a thorough documentation on line numbering in bash's error messages? I find it often quite misleading and would like to know what I am counting wrong. Any hint or help is appreciated. Dirk ___ Bug-bash ma

Re: Using variables in variables names

2006-03-14 Thread Dirk H. Schulz
Oh Mike, thanks a lot for such detailled and well structured clarification! That did it, now I can use it (and it gave my script a speedup of nearly 70 % less running time). Many thanks! Dirk Mike Stroyan schrieb: On 3/13/06, Paul Jarc <[EMAIL PROTECTED]> wrote: "Dir

Re: Using variables in variables names

2006-03-13 Thread Dirk H. Schulz
Paul Jarc schrieb: "Dirk H. Schulz" <[EMAIL PROTECTED]> wrote: ac=12 dings$ac=wasannersder -bash: dings12=wasannersder: command not found Variable names in assignments are not subject to expansion. So since "dings$ac", as-is, does not fit the syntax fo

Using variables in variables names

2006-03-13 Thread Dirk H. Schulz
"Advanced Bash Scripting Guide" mentions that it is possible to have them using indirect referencing - but I did not understand how this could be done. Any idea, hint or help? It would be a great relief after two days of search and resear