Aw: Re: Re: Inline `ifdef style` debugging

2011-08-11 Thread pjodrr
Am Donnerstag, 11. August 2011 12:40:24 UTC+2 schrieb Roger: > Just a quick response here, "ifdef style" is C code not compiled into the > compiled program if it is not defined or chosen to be enabled. This in turn, > prevents the CPU from wasting cycles testing if/then statements, etc... yes, I

Aw: Re: Re: Inline `ifdef style` debugging

2011-08-11 Thread pjodrr
Am Donnerstag, 11. August 2011 14:13:27 UTC+2 schrieb Greg Wooledge: > The problem with this is that you can't switch to the other function > later. this is intended. The idea is to call a script with a debug or no-debug option. So for the runtime of the script the debug() function does not chan

Aw: Re: Inline `ifdef style` debugging

2011-08-11 Thread pjodrr
Hello, Am Montag, 8. August 2011 19:20:25 UTC+2 schrieb Steven W. Orr: > > if (( debug )) > then > _debug() > { > "$@" > # I do question whether this is a viable construct, versus > # eval "$@" > } > else > _debug() > { > : > } > f

Aw: Re: Completion of ENV variables seems to be broken - leading slash (or even more) is added

2011-07-15 Thread pjodrr
Hello, Am Montag, 11. Juli 2011 04:08:13 UTC+2 schrieb Chet Ramey: > This will be optional behavior in the next release of bash. Users will > be able to choose whether or not they want word completion to perform > variable expansion and update the command line with the results. that's good news,

Aw: Re: Completion of ENV variables seems to be broken - leading slash (or even more) is added

2011-07-01 Thread pjodrr
Hello, Am Dienstag, 15. März 2011 21:44:37 UTC+1 schrieb Chet Ramey: > > The bash-4.1 solution, though it modified what the user typed, did not > result in any ambiguity. A filename was a filename, and if it contained > characters that needed to be quoted, readline did so. > > I might be able t

Re: Bash-4.1 available for FTP

2010-01-05 Thread pjodrr
Hello, On Jan 2, 6:41 pm, Chet Ramey wrote: > Unlike previous bash distributions, this tar file includes the formatted > documentation (postscript, dvi, html, and nroffed versions of the manual > pages). which makes the proxy/firewall of the company i'm working for atm block the download because

Re: output redirection with process substitution asynchronous?

2009-12-12 Thread pjodrr
Hello again, I have to reply to my own post to correct it: On Dec 8, 2:00 pm, pjodrr wrote: > coproc prefix_timestamp > seq 10>&${COPROC[1]} > eval "exec ${COPROC[1]}>&-" > cat <&${COPROC[0]} > wait $COPROC_PID replace this with: { coproc pr

Re: output redirection with process substitution asynchronous?

2009-12-08 Thread pjodrr
On Dec 8, 10:55 am, Marc Herbert wrote: > DennisW wrote : > > > Would you care to comment on the coproc command in Bash 4? > > I wish I could, but I know nothing about it. Anyone else? yeah, I tried that: prefix_timestamp() { while read line; do echo "$(date): $line" done } copr

Re: output redirection with process substitution asynchronous?

2009-12-08 Thread pjodrr
On Dec 8, 11:05 am, Marc Herbert wrote: > pk a écrit : > > > > > I disagree. All the further changes in the requirements because creating a > > subshell or being asynchronous is not acceptable etc. are not a goal in > > themselves, but rather the indicators that he's trying to accomplish > > somet

Re: output redirection with process substitution asynchronous?

2009-12-07 Thread pjodrr
Hi Marc, On Dec 7, 5:25 pm, Marc Herbert wrote: > Marc Herbert wrote: > > What is wrong with the following: > > > prefix_with_date () > > { > >     while read; do > >         printf '%s: %s\n' "$(date)" "$REPLY"; > >     done > > } > > > seq 4 | prefix_with_date > > ls | prefix_with_date > > Sorr

Re: output redirection with process substitution asynchronous?

2009-12-06 Thread pjodrr
On Dec 5, 3:51 pm, DennisW wrote: > On Dec 5, 3:14 am, pjodrr wrote: > > > > > Hello, > > > On Dec 4, 8:18 pm, DennisW wrote: > > > > It works for me. Does it not for you? If you're asking why not do it, > > > then the answer is "why c

Re: output redirection with process substitution asynchronous?

2009-12-06 Thread pjodrr
On Dec 5, 4:45 pm, pk wrote: > pjodrr wrote: > > Hi > > > On Dec 4, 7:58 pm, pk wrote: > >> What's wrong with > > >> seq 4 | while read line; do echo "$(date): $line"; done > > > it creates a subshell > > uh...where do you thin

Re: output redirection with process substitution asynchronous?

2009-12-05 Thread pjodrr
Hello, On Dec 4, 8:18 pm, DennisW wrote: > It works for me. Does it not for you? If you're asking why not do it, > then the answer is "why call an external program unnecessarily?". > > Sorry, by the way, I missed what you were doing with the file > descriptor on my first read. What is it that you

Re: output redirection with process substitution asynchronous?

2009-12-05 Thread pjodrr
Hi On Dec 4, 7:58 pm, pk wrote: > What's wrong with > > seq 4 | while read line; do echo "$(date): $line"; done it creates a subshell, "seq" was just an example, sorry for the confusion, it could be any other command, and it should run in the current shell. thanks, Peter

Re: output redirection with process substitution asynchronous?

2009-12-05 Thread pjodrr
On Dec 4, 7:46 pm, DennisW wrote: > > This should be in gnu.bash rather than gnu.bash.bug oh, you are right, it's not a bug yet > Would this work for you? > > while read line; do echo "$(date): $line $((num++))"; done ah sorry, I used the command "seq" just as an example, it could be any other

output redirection with process substitution asynchronous?

2009-12-04 Thread pjodrr
Hello, how can I prefix every line of output of some command with a timestamp? I thought like this: $ exec 3> >(while read line; do echo "$(date): $line"; done) $ seq 4 >&3 Friday, December 4, 2009 4:20:29 PM MET: 1 $ Friday, December 4, 2009 4:20:29 PM MET: 2 Friday, December 4, 2009 4:20