From pk at q-leap.com Tue Nov 17 09:05:49 2009 From: pk at q-leap.com (Peter Kruse) Date: Tue, 17 Nov 2009 08:05:49 +0100 (CET) Subject: Large history is very slow when starting or exiting tcsh (Issue #84) In-Reply-To: <20091025205534.717FC5654E@rebar.astron.com> References: <20091025205534.717FC5654E@rebar.astron.com> Message-ID: <34dbc20e5673d48dc3efb08e94a7f712.squirrel@www.q-leap.de> Hi, > On Oct 25, 2:57pm, ota at surfvi.com (Ted Anderson) wrote: > -- Subject: Large history is very slow when starting or exiting tcsh > (Issue # > > | I have a patch for this problem which I have attached to issue 84[1]. > The > | changes are concisely described in my check-in notes[2]. Let me know if > I > | should expand on these notes. I welcome comments on the code from > reviewers. > | > | It represents a fairly significant change to the history mechanism, so I > would > | like to solicit beta-testers. Especially, helpful would be folks that > use > | large histories or have the histdup variable set to "erase" or "all". I > would > | be happy to help apply the patch, provide (some) Linux binaries, and > respond to > | questions. > | > | Thanks in advance, > | Ted > | > | [1] http://bugs.gw.com/view.php?id=84 > | [2] http://bugs.gw.com/file_download.php?file_id=67&type=bug > | > > Thanks, I will try it on mine soon, but I don't logout a lot... I tried these patches and they are really a perfomance boost! I have about 12000 lines in the history file, and if I compare "echo true | tcsh -l" with and without the patch: without patch: 11 seconds with patches: 1 second this is amazing! While we're at it: it seems that "postcmd" is evaluated after each entry while reading the histfile initially, is that really neccessary? Regards, Peter From christos at zoulas.com Tue Nov 17 16:03:33 2009 From: christos at zoulas.com (Christos Zoulas) Date: Tue, 17 Nov 2009 09:03:33 -0500 Subject: Large history is very slow when starting or exiting tcsh (Issue #84) In-Reply-To: <34dbc20e5673d48dc3efb08e94a7f712.squirrel@www.q-leap.de> from "Peter Kruse" (Nov 17, 8:05am) Message-ID: <20091117140333.219C45654E@rebar.astron.com> On Nov 17, 8:05am, pk at q-leap.com ("Peter Kruse") wrote: -- Subject: Re: Large history is very slow when starting or exiting tcsh (Iss | Hi, | | > On Oct 25, 2:57pm, ota at surfvi.com (Ted Anderson) wrote: | > -- Subject: Large history is very slow when starting or exiting tcsh | > (Issue # | > | > | I have a patch for this problem which I have attached to issue 84[1]. | > The | > | changes are concisely described in my check-in notes[2]. Let me know if | > I | > | should expand on these notes. I welcome comments on the code from | > reviewers. | > | | > | It represents a fairly significant change to the history mechanism, so I | > would | > | like to solicit beta-testers. Especially, helpful would be folks that | > use | > | large histories or have the histdup variable set to "erase" or "all". I | > would | > | be happy to help apply the patch, provide (some) Linux binaries, and | > respond to | > | questions. | > | | > | Thanks in advance, | > | Ted | > | | > | [1] http://bugs.gw.com/view.php?id=84 | > | [2] http://bugs.gw.com/file_download.php?file_id=67&type=bug | > | | > | > Thanks, I will try it on mine soon, but I don't logout a lot... | | I tried these patches and they are really a perfomance boost! I have | about 12000 lines in the history file, and if I compare | "echo true | tcsh -l" with and without the patch: | without patch: 11 seconds | with patches: 1 second | | this is amazing! | While we're at it: it seems that "postcmd" is evaluated after each | entry while reading the histfile initially, is that really neccessary? Shouldn't be. christos From pk at q-leap.com Wed Nov 18 10:59:40 2009 From: pk at q-leap.com (Peter Kruse) Date: Wed, 18 Nov 2009 09:59:40 +0100 Subject: Large history is very slow when starting or exiting tcsh (Issue #84) In-Reply-To: <20091117140333.219C45654E@rebar.astron.com> References: <20091117140333.219C45654E@rebar.astron.com> Message-ID: <4B03B77C.3020805@q-leap.com> Hi Christos Zoulas wrote: > On Nov 17, 8:05am, pk at q-leap.com ("Peter Kruse") wrote: > | While we're at it: it seems that "postcmd" is evaluated after each > | entry while reading the histfile initially, is that really neccessary? > > Shouldn't be. hm, maybe it just looks like it. If I put alias postcmd 'echo -n "\033]2;`history -h 1`\007" | tr "\012" " "' and set echo in my .tcshrc and login I see the commands of the postcmd (echo, tr, history) printed and it looks that postcmd is run (or at least evaluated) even after comment lines of my .tcshrc and .login. It should be quite easy to reproduce this behaviour. Regards, Peter From ota at surfvi.com Thu Nov 19 05:06:56 2009 From: ota at surfvi.com (Ted Anderson) Date: Wed, 18 Nov 2009 23:06:56 -0400 Subject: Large history is very slow when starting or exiting tcsh (Issue #84) In-Reply-To: <34dbc20e5673d48dc3efb08e94a7f712.squirrel@www.q-leap.de> References: <20091025205534.717FC5654E@rebar.astron.com> <34dbc20e5673d48dc3efb08e94a7f712.squirrel@www.q-leap.de> Message-ID: <20091118230656.bok0g44gcs08scow@my.surfvi.com> Quoting Peter Kruse : >> On Oct 25, 2:57pm, ota at surfvi.com (Ted Anderson) wrote: >> -- Subject: Large history is very slow when starting or exiting tcsh >> (Issue # >> >> | I have a patch for this problem which I have attached to issue >> | 84[1]. The changes are concisely described in my check-in >> | notes[2]. Let me know if I should expand on these notes. I >> | welcome comments on the code from reviewers. >> | >> | It represents a fairly significant change to the history >> | mechanism, so I would like to solicit beta-testers. Especially, >> | helpful would be folks that use large histories or have the >> | histdup variable set to "erase" or "all". I would be happy to >> | help apply the patch, provide (some) Linux binaries, and respond >> | to questions. >> | >> | Thanks in advance, >> | Ted >> | >> | [1] http://bugs.gw.com/view.php?id=84 >> | [2] http://bugs.gw.com/file_download.php?file_id=67&type=bug >> | >> >> Thanks, I will try it on mine soon, but I don't logout a lot... > > I tried these patches and they are really a perfomance boost! I have > about 12000 lines in the history file, and if I compare > "echo true | tcsh -l" with and without the patch: > without patch: 11 seconds > with patches: 1 second > > this is amazing! I am very glad to see you are getting good results with this change. I updated defect #84[1] with a few changes (tcsh-6.17.01.diff[3]) that fix some small problems that I noticed (checkin-091111.txt[4]). Ted [3] http://bugs.gw.com/file_download.php?file_id=71&type=bug [4] http://bugs.gw.com/file_download.php?file_id=70&type=bug From ota at surfvi.com Thu Nov 19 05:12:15 2009 From: ota at surfvi.com (Ted Anderson) Date: Wed, 18 Nov 2009 23:12:15 -0400 Subject: Large history is very slow when starting or exiting tcsh (Issue #84) In-Reply-To: <4B03B77C.3020805@q-leap.com> References: <20091117140333.219C45654E@rebar.astron.com> <4B03B77C.3020805@q-leap.com> Message-ID: <20091118231215.3cc0css4k0g0scc0@my.surfvi.com> Quoting Peter Kruse : > Christos Zoulas wrote: >> On Nov 17, 8:05am, pk at q-leap.com ("Peter Kruse") wrote: >> | While we're at it: it seems that "postcmd" is evaluated after each >> | entry while reading the histfile initially, is that really neccessary? >> >> Shouldn't be. > > hm, maybe it just looks like it. If I put > > alias postcmd 'echo -n "\033]2;`history -h 1`\007" | tr "\012" " "' > > and > > set echo > > in my .tcshrc and login I see the commands of the postcmd > (echo, tr, history) printed and it looks that postcmd > is run (or at least evaluated) even after comment lines of my .tcshrc and > .login. It should be quite easy to reproduce this behaviour. I tried something similar by setting a postcmd alias that displays the date in my .tcshrc and then started "tcsh -l". I saw 46 lines from the postcmd, but that number was the same when I had a 5 line history and when I had a 15,000 line history. I have 1 line in my .tcshrc and 44 lines in .login (45 in total). From this I conclude that it is running the postcmd for .tcshrc and .login lines, but not while reading the histfile. Ted From aleksey.yakovlev at gmail.com Sun Nov 22 03:22:51 2009 From: aleksey.yakovlev at gmail.com (Aleksey Yakovlev) Date: Sat, 21 Nov 2009 20:22:51 -0500 Subject: How does tcsh pass parameters to Perl? Message-ID: <943dc8bc0911211722v66db431axb7d78dde1b7737d4@mail.gmail.com> Hello, tcsh experts My Perl program "Test" accepts an option "abc" and prints its value: #!/usr/bin/perl use diagnostics; use warnings; use strict; use Getopt::Long(); my %opt; Getopt::Long::GetOptions(\%opt, 'abc=s'); print "($opt{abc})\n"; My tcsh script (below) calls this program two times - first time with the option (and its value) embedded into the command line, and second time with the same option referred via a shell variable. Please notice, that option value consists of two words - this is most important here, because it forces me to use extra quotes. #!/bin/tcsh -f set p = '-abc "xyz xyz"' Test.pl -abc "xyz xyz" Test.pl $p Results are different: (xyz xyz) ("xyz) What did I do wrong? I really need to call Perl from tcsh, and I need to pass options to this Perl, and these options are defined as shell variables, and their values are multi-word ones - how to do that? Thank you in advance, Aleksey From kimmo at suominen.com Sun Nov 22 04:04:05 2009 From: kimmo at suominen.com (Kimmo Suominen) Date: Sat, 21 Nov 2009 21:04:05 -0500 Subject: How does tcsh pass parameters to Perl? In-Reply-To: <943dc8bc0911211722v66db431axb7d78dde1b7737d4@mail.gmail.com> References: <943dc8bc0911211722v66db431axb7d78dde1b7737d4@mail.gmail.com> Message-ID: Hi Aleksey, Use "/bin/tcsh -fvx" to see what is happening. To get what you want, use: eval Test.pl $p Cheers, + Kim On Sat, Nov 21, 2009 at 20:22, Aleksey Yakovlev wrote: > Hello, tcsh experts > > My Perl program "Test" accepts an option "abc" and prints its value: > > #!/usr/bin/perl > use diagnostics; > use warnings; > use strict; > use Getopt::Long(); > my %opt; > Getopt::Long::GetOptions(\%opt, 'abc=s'); > print "($opt{abc})\n"; > > My tcsh script (below) calls this program two times - first time with the > option (and its value) embedded into the command line, and second time with > the same option referred via a shell variable. Please notice, that option > value consists of two words - this is most important here, because it > forces me to use extra quotes. > > #!/bin/tcsh -f > set p = '-abc "xyz xyz"' > Test.pl -abc "xyz xyz" > Test.pl $p > > Results are different: > > (xyz xyz) > ("xyz) > > What did I do wrong? I really need to call Perl from tcsh, and I need to > pass options to this Perl, and these options are defined as shell > variables, > and their values are multi-word ones - how to do that? > > Thank you in advance, > Aleksey > _______________________________________________ > Tcsh mailing list > Tcsh at mx.gw.com > http://mx.gw.com/mailman/listinfo/tcsh > From cjep at fawlty.net Sun Nov 22 10:18:43 2009 From: cjep at fawlty.net (Chris Pinnock) Date: Sun, 22 Nov 2009 08:18:43 +0000 Subject: How does tcsh pass parameters to Perl? In-Reply-To: <943dc8bc0911211722v66db431axb7d78dde1b7737d4@mail.gmail.com> References: <943dc8bc0911211722v66db431axb7d78dde1b7737d4@mail.gmail.com> Message-ID: <6BE20D8B-9520-4C31-892A-776BB7593F20@fawlty.net> Not had my first coffee of the day yet but for long options should you be writing --abc ie two hyphens? Sent from my iPhone On 22 Nov 2009, at 01:22, Aleksey Yakovlev wrote: > Hello, tcsh experts > > My Perl program "Test" accepts an option "abc" and prints its value: > > #!/usr/bin/perl > use diagnostics; > use warnings; > use strict; > use Getopt::Long(); > my %opt; > Getopt::Long::GetOptions(\%opt, 'abc=s'); > print "($opt{abc})\n"; > > My tcsh script (below) calls this program two times - first time > with the > option (and its value) embedded into the command line, and second > time with > the same option referred via a shell variable. Please notice, that > option > value consists of two words - this is most important here, because it > forces me to use extra quotes. > > #!/bin/tcsh -f > set p = '-abc "xyz xyz"' > Test.pl -abc "xyz xyz" > Test.pl $p > > Results are different: > > (xyz xyz) > ("xyz) > > What did I do wrong? I really need to call Perl from tcsh, and I > need to > pass options to this Perl, and these options are defined as shell > variables, > and their values are multi-word ones - how to do that? > > Thank you in advance, > Aleksey > _______________________________________________ > Tcsh mailing list > Tcsh at mx.gw.com > http://mx.gw.com/mailman/listinfo/tcsh From christos at zoulas.com Sun Nov 22 18:32:00 2009 From: christos at zoulas.com (Christos Zoulas) Date: Sun, 22 Nov 2009 11:32:00 -0500 Subject: How does tcsh pass parameters to Perl? In-Reply-To: <943dc8bc0911211722v66db431axb7d78dde1b7737d4@mail.gmail.com> from Aleksey Yakovlev (Nov 21, 8:22pm) Message-ID: <20091122163200.6F6775654E@rebar.astron.com> On Nov 21, 8:22pm, aleksey.yakovlev at gmail.com (Aleksey Yakovlev) wrote: -- Subject: How does tcsh pass parameters to Perl? | Hello, tcsh experts | | My Perl program "Test" accepts an option "abc" and prints its value: | | #!/usr/bin/perl | use diagnostics; | use warnings; | use strict; | use Getopt::Long(); | my %opt; | Getopt::Long::GetOptions(\%opt, 'abc=s'); | print "($opt{abc})\n"; | | My tcsh script (below) calls this program two times - first time with the | option (and its value) embedded into the command line, and second time with | the same option referred via a shell variable. Please notice, that option | value consists of two words - this is most important here, because it | forces me to use extra quotes. | | #!/bin/tcsh -f | set p = '-abc "xyz xyz"' | Test.pl -abc "xyz xyz" | Test.pl $p | | Results are different: | | (xyz xyz) | ("xyz) | | What did I do wrong? I really need to call Perl from tcsh, and I need to | pass options to this Perl, and these options are defined as shell variables, | and their values are multi-word ones - how to do that? | Nothing wrong, tcsh is broken. if you use $p:q or "$p" then it gets over-quoted. christos From douglist at macnauchtan.com Sun Nov 22 23:21:51 2009 From: douglist at macnauchtan.com (Doug McNutt) Date: Sun, 22 Nov 2009 14:21:51 -0700 Subject: How does tcsh pass parameters to Perl? In-Reply-To: <20091122163200.6F6775654E@rebar.astron.com> References: <20091122163200.6F6775654E@rebar.astron.com> Message-ID: At 11:32 -0500 11/22/09, Christos Zoulas wrote, and I snipped...: >On Nov 21, 8:22pm, aleksey.yakovlev at gmail.com (Aleksey Yakovlev) wrote: >-- Subject: How does tcsh pass parameters to Perl? > >| >| What did I do wrong? I really need to call Perl from tcsh, and I need to >| pass options to this Perl, and these options are defined as shell variables, >| and their values are multi-word ones - how to do that? >| > >Nothing wrong, tcsh is broken. if you use $p:q or "$p" then it gets over-quoted. > As a work around. The xargs tool might help. At least the man page talks about escaping funny characters for you. You could also use perl's $ENV{} hash if you make sure the tcsh variables are environment style. -- --> A fair tax is one that you pay but I don't <-- From aleksey.yakovlev at gmail.com Mon Nov 23 01:30:50 2009 From: aleksey.yakovlev at gmail.com (Aleksey Yakovlev) Date: Sun, 22 Nov 2009 18:30:50 -0500 Subject: How does tcsh pass parameters to Perl? In-Reply-To: References: <20091122163200.6F6775654E@rebar.astron.com> Message-ID: <943dc8bc0911221530i2017013h86f1d313d1ae347a@mail.gmail.com> On Sun, Nov 22, 2009 at 4:21 PM, Doug McNutt wrote: > At 11:32 -0500 11/22/09, Christos Zoulas wrote, and I snipped...: > >On Nov 21, 8:22pm, aleksey.yakovlev at gmail.com (Aleksey Yakovlev) wrote: > >-- Subject: How does tcsh pass parameters to Perl? > > > >| > >| What did I do wrong? I really need to call Perl from tcsh, and I need to > >| pass options to this Perl, and these options are defined as shell > variables, > >| and their values are multi-word ones - how to do that? > >| > > > >Nothing wrong, tcsh is broken. if you use $p:q or "$p" then it gets > over-quoted. > > > > As a work around. > > The xargs tool might help. At least the man page talks about escaping funny > characters for you. > > You could also use perl's $ENV{} hash if you make sure the tcsh variables > are environment style. > -- > > --> A fair tax is one that you pay but I don't <-- > > _______________________________________________ > Tcsh mailing list > Tcsh at mx.gw.com > http://mx.gw.com/mailman/listinfo/tcsh > I've found (finally!) another workaround: #!/bin/tcsh -f set pn = -abc set pv = (xyz xyz) Test.pl $pn "$pv" Thank you all! Alex