tillmann.crue...@telekom.de wrote:
> I have produced the following script as a small example:
A good small example! I do not understand the problem but I do have a
question about one of the lines in it and a comment about another.
> trap "kill $?; exit 0" INT TERM
What did you intend with "kill
On Thu, May 3, 2012 at 2:53 AM, Pierre Gaston wrote:
> On Thu, May 3, 2012 at 9:34 AM, Pan ruochen wrote:
>> Hi All,
>>
>> Suddenly I found that ((i++)) is not supported on bash.
>> Just try the following simple case:
>> $i=0; ((i++)); echo $?
>> And the result is
>> 1
>> which means an error.
>>
Yes, you are correct, that line is buggy and contains a typo. I added it later
in a hurry after I could reproduce the error, to ensure a clean shutdown of the
script. What I meant to type was:
> trap "kill $!; exit 0" INT TERM
However thinking about it, this also does not work as intended.
The
Bob Proulx writes:
> And lastly I will comment that you are doing quite a bit inside of an
> interrupt routine. Typically in a C program it is not safe to perform
> any operation that may call malloc() within an interupt service
> routine since malloc isn't reentrant. Bash is a C program and I
On Thu, May 03, 2012 at 02:34:16PM +0800, Pan ruochen wrote:
> $i=0; ((i++)); echo $?
> And the result is
> 1
Which means it's supported.
> which means an error.
http://mywiki.wooledge.org/BashFAQ/105
--- Begin Message ---
Hi,
please try the following bash script:
a=x
del="$(echo -e "\\x7f")"
echo "$del${a#x}" | od -ta
echo "$del ${a#x}" | od -ta
echo " $del${a#x}" | od -ta
Using bash 3.2, the output is:
000 del nl
002
000 del sp nl
003
000 sp del nl
003
howeve
> Yours, Rüdiger.
> a=x
> del="$(echo -e "\\x7f")"
>
> echo "$del${a#x}" | od -ta
> echo "$del ${a#x}" | od -ta
> echo " $del${a#x}" | od -ta
Yup, confirmed that it breaks here, and only when the # parameter expansion
is included.
imadev:~$ del=$'\x7f' a=x b=
imadev:~$ echo " $del$b" | od -ta
0
Am 03.05.2012 15:01, schrieb Greg Wooledge:
>> Yours, Rüdiger.
>> a=x
>> del="$(echo -e "\\x7f")"
>>
>> echo "$del${a#x}" | od -ta
>> echo "$del ${a#x}" | od -ta
>> echo " $del${a#x}" | od -ta
> Yup, confirmed that it breaks here, and only when the # parameter expansion
> is included.
>
> imadev:~$
Am 03.05.2012 19:41, schrieb John Kearney:
> Am 03.05.2012 15:01, schrieb Greg Wooledge:
>>> Yours, Rüdiger.
>>> a=x
>>> del="$(echo -e "\\x7f")"
>>>
>>> echo "$del${a#x}" | od -ta
>>> echo "$del ${a#x}" | od -ta
>>> echo " $del${a#x}" | od -ta
>> Yup, confirmed that it breaks here, and only when t
On Thu, 3 May 2012, DJ Mills wrote:
On Thu, May 3, 2012 at 2:53 AM, Pierre Gaston wrote:
On Thu, May 3, 2012 at 9:34 AM, Pan ruochen wrote:
Hi All,
Suddenly I found that ((i++)) is not supported on bash.
Just try the following simple case:
$i=0; ((i++)); echo $?
And the result is
1
which me
Hi there,
I don't know if this is anything that has ever been discussed or
considered, but would be interested in any thoughts.
I frequently find myself these days writing shell scripts, to run on
multi-core machines, which could easily exploit lots of parallelism (eg. a
batch of a hundred indepe
Here is a construct that I use sometimes... although you might wind up
waiting for the slowest job in each iteration of the loop:
maxiter=100
ncore=8
for iter in $(seq 1 $maxiter)
do
startjob $iter &
if (( (iter % $ncore) == 0 ))
then
wait
fi
done
On Thu, May 3, 2012 at 12:49 PM,
Indeed, I've used variations of most of these in the past. :)
My contention is that this is the sort of thing that more people will want to
do more frequently, and that this is a reasonable argument in favour of
including the functionality *correctly* in the core language for maximum
expressive
On Thu, May 03, 2012 at 08:45:57PM +0100, Colin McEwan wrote:
> My contention is that this is the sort of thing that more people will want to
> do more frequently, and that this is a reasonable argument in favour of
> including the functionality *correctly* in the core language for maximum
> expres
I tend to do something more like this
function runJobParrell {
local mjobCnt=${1} && shift
jcnt=0
function WrapJob {
"${@}"
kill -s USR2 $$
}
function JobFinised {
jcnt=$((${jcnt}-1))
}
trap JobFinised
On Thu, May 03, 2012 at 10:12:17PM +0200, John Kearney wrote:
> function runJobParrell {
> local mjobCnt=${1} && shift
> jcnt=0
> function WrapJob {
> "${@}"
> kill -s USR2 $$
> }
> function JobFinised {
> jcnt=$((${jcn
Am 03.05.2012 22:30, schrieb Greg Wooledge:
> On Thu, May 03, 2012 at 10:12:17PM +0200, John Kearney wrote:
>> function runJobParrell {
>> local mjobCnt=${1} && shift
>> jcnt=0
>> function WrapJob {
>> "${@}"
>> kill -s USR2 $$
>> }
>>
This version might be easier to follow. The last version was more for
being able to issue commands via a fifo to a job queue server.
function check_valid_var_name {
case "${1:?Missing Variable Name}" in
[!a-zA-Z_]* | *[!a-zA-Z_0-9]* ) return 3;;
esac
}
CNiceLevel=$(nice)
On Thursday 03 May 2012 16:12:17 John Kearney wrote:
> I tend to do something more like this
>
> function runJobParrell {
> local mjobCnt=${1} && shift
> jcnt=0
> function WrapJob {
> "${@}"
> kill -s USR2 $$
> }
neat trick. all my para
BASH PATCH REPORT
=
Bash-Release: 4.2
Patch-ID: bash42-025
Bug-Reported-by:Bill Gradwohl
Bug-Reference-ID:
Bug-Reference-URL:
http://lists.gnu.org/archive/html/help-bash/2012-03/msg00078.html
BASH PATCH REPORT
=
Bash-Release: 4.2
Patch-ID: bash42-026
Bug-Reported-by:Greg Wooledge
Bug-Reference-ID: <20120425180443.go22...@eeg.ccf.org>
Bug-Reference-URL:
http://lists.gnu.org/archive/ht
BASH PATCH REPORT
=
Bash-Release: 4.2
Patch-ID: bash42-027
Bug-Reported-by:Mike Frysinger
Bug-Reference-ID: <201204211243.30163.vap...@gentoo.org>
Bug-Reference-URL:
http://lists.gnu.org/archive
BASH PATCH REPORT
=
Bash-Release: 4.2
Patch-ID: bash42-028
Bug-Reported-by:Mark Edgar
Bug-Reference-ID:
Bug-Reference-URL:
http://lists.gnu.org/archive/html/bug-bash/2012-03/msg00109.html
Bug
23 matches
Mail list logo