Chet Ramey wrote:
> seba wrote:
>> #!/bin/sh
>>
>> fib() {
> You managed to write yourself an infinitely-recursive function, and
> eventually ran out of stack space. `==' is a string operator, not a
> numeric operator, when used with `['.
Most likely. When I test this and it breaks, the stack h
On Wed, Dec 12, 2007 at 12:31:47AM EST, Bob Proulx wrote:
> cga2000 wrote:
> > I was wondering if there is any way I can convince netstat to return
> > its output to bash variables for additional processing.
>
> Do you mean like this?
>
> rxcnt=$(netstat -ni | awk '/^eth0/{print$4}')
Precise
Gary Fritz wrote:
> I just installed SysInternals' FileMon utility and have discovered all
> kinds of unknown activity going on behind the scenes.
>
> One that surprised me was Bash. FileMon says that Bash is doing 90-100
> FSCTL_PIPE_SEEK operations EVERY SECOND! It does this even if a comman
seba wrote:
> GNU bash, version 3.2.25(1)-release (i686-pc-linux-gnu)
> Copyright (C) 2005 Free Software Foundation, Inc.
>
> #!/bin/sh
>
> fib() {
>n=$1
>[ $n == 0 -o $n == 1 ] && return $n
>fib $(($n-1))
>ret1=$?
>fib $(($n-2))
>ret2=$?
>r
>
> Repeat-By:
> a=111.1
> echo ${a//[0-9]/x}
>
> correctly gives "xxx.x", but
>
> echo ${a//[0-9]/*}
>
> gives a listing of files in current directory. Seems that the "*"
> is expanded before replacing the pattern.
>
> It workes the right way at least up to bash-3.1.17(
[EMAIL PROTECTED] writes:
> Repeat-By:
> $ function fun(){ echo running fun;}
> $ function fu~(){ echo running fu~;}
> $ fun
> running fun
> $ fu~
> running fu~
> $ unset fun
> $ unset fu~
> bash: unset: `fu~': not
Heinz-Ado Arnolds <[EMAIL PROTECTED]> writes:
> Repeat-By:
> a=111.1
> echo ${a//[0-9]/x}
>
> correctly gives "xxx.x", but
>
> echo ${a//[0-9]/*}
>
> gives a listing of files in current directory.
Only those that contain a period.
> Seems that the "*"
> is expanded be
[EMAIL PROTECTED] wrote:
> $ unset fu~
> bash: unset: `fu~': not a valid identifier
You can use "unset -f" to unset a function whose name doesn't fit the
rules for variable names.
paul
Heinz-Ado Arnolds <[EMAIL PROTECTED]> wrote:
> a=111.1
> echo ${a//[0-9]/x}
>
> correctly gives "xxx.x", but
>
> echo ${a//[0-9]/*}
>
> gives a listing of files in current directory. Seems that the "*"
> is expanded before replacing the pattern.
No, it's expanded afterward,
> unset strangely rejects certain function names eg fu~
> $ function fun(){ echo running fun;}
> $ function fu~(){ echo running fu~;}
> $ fun
> running fun
> $ fu~
> running fu~
> $ unset fun
> $ unset fu~
>
GNU bash, version 3.2.25(1)-release (i686-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
#!/bin/sh
fib() {
n=$1
[ $n == 0 -o $n == 1 ] && return $n
fib $(($n-1))
ret1=$?
fib $(($n-2))
ret2=$?
return $(($ret1 + $ret2))
}
for ((i=0
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-redhat-linux-gnu'
-DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPAC
I was wondering if there is any way I can convince netstat to return
its output to bash variables for processing.
Pretty simple logic:
Do forever:
Call netstat to obtain RX & TX byte counts
Print delta {current .. minus previous .. byte counts}
Save current byte counts
Wait for a secon
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='b
I just installed SysInternals' FileMon utility and have discovered all
kinds of unknown activity going on behind the scenes.
One that surprised me was Bash. FileMon says that Bash is doing 90-100
FSCTL_PIPE_SEEK operations EVERY SECOND! It does this even if a command is
running, so there is n
15 matches
Mail list logo