or example, this code prints the script location of every fork().
-
// bash-syspose.c - interpose so that bash shell prints $PS4 upon syscall
// Copyright 2011 John Reiser, BitWagon Software LLC. All rights reserved.
// Licensed under GNU General Public License, version 3 (GPLv3).
//
// Requir
Peng Yu wrote:
> I know that I should use =~ to match regex (bash version 4).
>
> However, the man page is not very clear. I don't find how to match
> (matching any single character). For example, the following regex
> doesn't match txt. Does anybody know how to match any character
> (should b
On 05/29/2013 01:35 AM, Harald Hoyer wrote:
> On 04/24/2013 05:26 PM, Chet Ramey wrote:
>> On 4/23/13 2:05 AM, Harald Hoyer wrote:
>>> As reported in http://savannah.gnu.org/patch/?8025 , I would like to see the
>>> SIGRTMAX-n signal names disappear.
>>>
>>> Signals should never ever be addressed w
> I took a look and saw the bash process consuming as much as 3+ GB of
> memory. I'm not doing anything where I'd expect to be consuming that
> much memory.
As a workaround, try using "ulimit -v" to restrict the virtual memory
space of the shell itself. (For invoking some child processes, it m
Hi,
Would it be possible for bash to detect just-in-time the last subprocess
that it will execute, and then do only an 'execve' instead of a fork+execve?
This might save a lot of operating system overhead for process creation:
perhaps upto 10% over the course of a day, especially for most uses of
On 08/04/2009 12:48 AM, fam...@icdsoft.com wrote:
First I would like to say that I'm not sure if this is a bug or a
feature of Bash.
If it is a feature, please let me know how to turn it off; or better
make it disabled by default...
The problem is that Bash does
Ultimately I need to do I/O through a named pipe and I
need to be able to restart the writer without restarting the reader.
The reader of a fifo will not be terminated as long as there is
at least one writer to the fifo. Therefore, create a second writer.
For example, to hold the fifo open for
... the age old convention of using upper case names
for all their shell variables. ...
It reminds some programmers that a '$' is necessary for expansion.
It is somewhat like using all capitals for #define macros in C
(where the expansion is automatic, but still different from other
symbols that
#!/bin/bash
> /tmp/foo
exec 1>/tmp/foo
echo a
echo B>>/tmp/foo
echo c
echo D>>/tmp/foo
echo e
echo F>>/tmp/foo
That script creates two simultaneous writers of /tmp/foo
(one via the "exec >", another via each "echo >>")
but does not provide any concurrency control.
Shame on the script; the resu
Program received signal SIGFPE, Arithmetic exception.
0x00462cd5 in exp2 () at expr.c:761
761 val1 /= val2;
(gdb) print val1
$1 = -9223372036854775808
(gdb) print val2
$2 = -1
which is strange.
Not at all. Overflow invokes undefined behaviour.
But why there is no overflow on 32bit s
On 06/18/2010 07:05 AM, Dr. Werner Fink wrote:
> Just a remark about the sub shell usage in bash in comparision to
> ksh. Let's try:
>
> strace -f -o bash.strace bash -c 'echo a b | read a b'
> > grep -E 'execve|clone|write\(1|read\(0' bash.strace
[snip]
>
> and now the same with the K
> I have command completion in my bash command. But I need to input tab
> in the command line. Is there a way to do so?
Quote the with V.
$ echo ' ' | od -c # e c h o V
000 \t \n
002
$ echo '' | od -c # e c h o
000 \n
001
$
--
> Could anybody let me know the complete set of characters that need to
> be escaped (prepend with backslash) between a pair of double quotes if
> I really want to print the character?
RTFM. In particular, the manual page ("man bash") has a succinct section
entitled "QUOTING".
--
> Lastly since ^J is a newline you can generate one with echo "\n".
That does not work in bash-4.x. Firstly, by default the bash builtin
'echo' supplies a trailing newline. Secondly, backslash translation
requires the option "-e".
$ echo "\n"
\n
$ echo "\n" | od -c
000 \ n \n
003
$
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-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale'
15 matches
Mail list logo