Hello again,
I have to reply to my own post to correct it:
On Dec 8, 2:00 pm, pjodrr pjo...@gmail.com wrote:
coproc prefix_timestamp
seq 10${COPROC[1]}
eval exec ${COPROC[1]}-
cat ${COPROC[0]}
wait $COPROC_PID
replace this with:
{ coproc prefix_timestamp 3 ; } 31
seq 10${COPROC[1]}
eval
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
something else.
I think he just want side-effects like in
On Dec 8, 11:05 am, Marc Herbert marc.herb...@gmail.com 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
On Dec 8, 10:55 am, Marc Herbert marc.herb...@gmail.com 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
pjodrr wrote:
It would be nice if you explained what it is you're attempting to do, rather
than ask for a solution for what you're thinking would do that.
To be honest that is the first thing he (tried to) do:
pjodrr wrote:
how can I prefix every line of output of some command with a
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
Sorry I missed the fact that you want to run your commands in the current shell.
On Dec 7, 10:25 am, Marc Herbert marc.herb...@gmail.com 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
Sorry I missed
Hi Marc,
On Dec 7, 5:25 pm, Marc Herbert marc.herb...@gmail.com 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
Sorry I
On Dec 5, 4:45 pm, pk p...@pk.invalid wrote:
pjodrr wrote:
Hi
On Dec 4, 7:58 pm, pk p...@pk.invalid wrote:
What's wrong with
seq 4 | while read line; do echo $(date): $line; done
it creates a subshell
uh...where do you think your original
(while read line; do echo $(date): $line;
pjodrr wrote:
in my original example the seq 4 runs in the current shell
while here the command runs in a subshell.
It would be nice if you explained what it is you're attempting to do, rather
than ask for a solution for what you're thinking would do that.
On Dec 4, 7:46 pm, DennisW dennistwilliam...@gmail.com 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
Hello,
On Dec 4, 8:18 pm, DennisW dennistwilliam...@gmail.com 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
On Dec 4, 9:28 am, pjodrr pjo...@gmail.com wrote:
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,
pjodrr wrote:
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,
On Dec 4, 12:58 pm, pk p...@pk.invalid wrote:
pjodrr wrote:
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
$
15 matches
Mail list logo