Not sure if this is a documentation bug or a functional one, but the man page
does not seem to agree with the observed behavior for return when invoked in
DEBUG traps.
return [n]
Causes a function to stop executing and return the value specified
by n to its caller. If n is omitted, the re
On 11/19/15, Ángel González wrote:
> Dennis Williamson wrote:
>> Do you mean something like:
>>
>> PS1='$SECONDS '
>
> Not exactly. $SECONDS is the number of seconds since the shell was
> started. I am interested in the seconds elapsed by the last command.
>
> It is a hacky solution, but it could
Dennis Williamson wrote:
> Do you mean something like:
>
> PS1='$SECONDS '
Not exactly. $SECONDS is the number of seconds since the shell was
started. I am interested in the seconds elapsed by the last command.
It is a hacky solution, but it could be done with:
> PS1=''; PROMPT_COMMAND='printf "
On Wed, Nov 18, 2015 at 12:29:15PM -0800, Linda Walsh wrote:
> Greg Wooledge wrote:
> >An argument cannot contain a NUL byte. So it's moot.
> ---
> As in:
> >printf '"%c"\n' $'\x00'|hexdump -C
> 22 00 22 0a |".".|
imadev:~$ printf '"%c"\n' ''
Greg Wooledge wrote:
On Wed, Nov 18, 2015 at 10:46:57AM -0800, Linda Walsh wrote:
One thing that seems to be another problem. Greg called
my attention to another printf format bug:
%q causes printf to output the corresponding argument in
a
Why does bash clear OLDPWD when a child script is started?
OLDPWD is exported and passed to any children, but bash apparently clears
OLDPWD whenever a child script is started:
$ cd /etc
$ cd
$ perl -e 'print "<$ENV{OLDPWD}>\n"'
$ ksh -c 'echo "<$OLDPWD>"'
$ bash -c 'echo "<$OLDPWD>"'
<>
$ un
Greg Wooledge wrote:
You should stop using irrelevant examples, and return to your core
question. I believe your initial goal was to run a command, and capture
the command's stdout in one variable, and the command's stderr in another
variable, without using any temp files.
Actual
On Wed, Nov 18, 2015 at 10:46:57AM -0800, Linda Walsh wrote:
> One thing that seems to be another problem. Greg called
> my attention to another printf format bug:
>
> %q causes printf to output the corresponding argument in
> a
> format
On Wed, Nov 18, 2015 at 10:16:46AM -0800, Linda Walsh wrote:
> So just like you can have [<>|]&[-0-9][0-0] as redirection ops that
> work
> with files or FD's, why not have something like:
>
> out=()
> printf '%s\0' "${array[@]}" >&{out[@]} (**)
>
> **: or ">@out" or ">&@out"
You se
konsolebox wrote:
On Fri, Nov 13, 2015 at 8:45 AM, Linda Walsh wrote:
I'd like to be able to record stdout and stderr
without using any temp files into bash array files, AND
record the status of the command executed.
You can use coproc processes that would act as buffers.
Obvious Note: Avo
Greg Wooledge wrote:
On Sun, Nov 15, 2015 at 05:26:26AM -0800, Linda Walsh wrote:
This can be used to serialize an array into a file
and to read it back:
printf '%s\0' "${array[@]}" > file
So just like you can have [<>|]&[-0-9][0-0] as redirection ops that work
with files or FD's
11 matches
Mail list logo