Thread View: news.software.readers
3 messages
3 total messages
Started by Tim Pierce
Sun, 25 Oct 1992 19:07
Problems specifying regexps when shelling out of trn
Author: Tim Pierce
Date: Sun, 25 Oct 1992 19:07
Date: Sun, 25 Oct 1992 19:07
17 lines
1630 bytes
1630 bytes
I've run into an odd problem when forking a new shell from trn with the "!" command. If I attempt to specify certain regular expressions in the shell command, for example "grep '^comp' /usr/lib/news/active", I get no output whatsoever. Apparently the regexp is being munged before the command has a chance to be executed. I've tried "^comp" surrounded by single quotes, double quotes, and neither. I don't have any problems using $ or other metacharacters. At one point I tried "!echo grep '^comp' /usr/lib/news/active" to see what that would do, and it spat back "grep omp /usr/lib/news/active". But if that's how the grep command is coming out, it should give me *some* output, even if it's not what I really want. Any ideas? -- ____ Tim Pierce / "You are just naive and repressed because \ / twpierce@unix.amherst.edu / penis envy is here and it's now and it's \/ (BITnet: TWPIERCE@AMHERST) / all around you." -- Neal C. Wickham
Re: Problems specifying regexps when shelling out of trn
Author: Sridhar Venkataraman
Date: Mon, 26 Oct 1992 01:16
Date: Mon, 26 Oct 1992 01:16
77 lines
3117 bytes
3117 bytes
twpierce@unix.amherst.edu (Tim Pierce) writes on news.software.readers: )I've run into an odd problem when forking a new shell from trn with )the "!" command. If I attempt to specify certain regular expressions )in the shell command, for example "grep '^comp' /usr/lib/news/active", )I get no output whatsoever. Apparently the regexp is being munged )before the command has a chance to be executed. I've tried "^comp" )surrounded by single quotes, double quotes, and neither. I don't have )any problems using $ or other metacharacters. [n.n.q mode on] Ok, what is the shell you are running? :-) [n.n.q mode off] My setup involves sh, csh (4.3 BSD tahoe) tcsh (6.00.02) and trn (2.2). Take your pick... Sridhar. ---script from a session follows .... **** 2 in asu.acm--read? [+ynq] &&w !grep %"Pattern: " /tmp/rrnact.%$ **** 2 in asu.acm--read? [+ynq] && Macros: w !grep %"Pattern: " /tmp/rrnact.%$ **** 2 in asu.acm--read? [+ynq] &-ESHELL=/bin/sh **** 2 in asu.acm--read? [+ynq] Pattern: \^asu.ac !grep \^asu.ac /tmp/rrnact.3312 /bin/sh: asu.ac: not found grep: usage: grep [-bchilnosvwy] [-e] pattern [file ...] **** 2 in asu.acm--read? [+ynq] Pattern: '^asu.ac' !grep '^asu.ac' /tmp/rrnact.3312 **** 2 in asu.acm--read? [+ynq] Pattern: '\^asu.ac' !grep '\^asu.ac' /tmp/rrnact.3312 asu.acm 000000002 00001 y **** 2 in asu.acm--read? [+ynq] &-ESHELL=/bin/csh **** 2 in asu.acm--read? [+ynq] Pattern: ^asu.ac !grep ^asu.ac /tmp/rrnact.3312 **** 2 in asu.acm--read? [+ynq] Pattern: \^asu.ac !grep \^asu.ac /tmp/rrnact.3312 asu.acm 000000002 00001 y **** 2 in asu.acm--read? [+ynq] Pattern: '^asu.ac'^H !grep '^asu.ac' /tmp/rrnact.3312 **** 2 in asu.acm--read? [+ynq] &-ESHELL=/usr/local/bin/tcsh **** 2 in asu.acm--read? [+ynq] Pattern: ^asu.ac !grep ^asu.ac /tmp/rrnact.3312 **** 2 in asu.acm--read? [+ynq] Pattern: \^asu.ac !grep \^asu.ac /tmp/rrnact.3312 asu.acm 000000002 00001 y **** 2 in asu.acm--read? [+ynq] Pattern: '\^asu.ac' !grep '\^asu.ac' /tmp/rrnact.3312 asu.acm 000000002 00001 y **** 2 in asu.acm--read? [+ynq] Pattern: \'\^asu.ac\' !grep \'\^asu.ac\' /tmp/rrnact.3312 asu.acm 000000002 00001 y -- Sridhar Venkataraman sridhar@asuvax.eas.asu.edu
Re: Problems specifying regexps when shelling out of trn
Author: Tim Pierce
Date: Mon, 26 Oct 1992 07:56
Date: Mon, 26 Oct 1992 07:56
27 lines
1933 bytes
1933 bytes
In article <1992Oct26.011624.4983@ennews.eas.asu.edu> sridhar@homecheese.var.asu.edu (Sridhar Venkataraman) writes: >twpierce@unix.amherst.edu (Tim Pierce) >writes on news.software.readers: > >)I've run into an odd problem when forking a new shell from trn with >)the "!" command. If I attempt to specify certain regular expressions >)in the shell command, for example "grep '^comp' /usr/lib/news/active", >)I get no output whatsoever. > >Ok, what is the shell you are running? :-) <blush> Like *I* shouldn't know enough to say. Tcsh 6.02. Ultrix 4.2a, by the way, and trn 4.4. >My setup involves sh, csh (4.3 BSD tahoe) tcsh (6.00.02) and trn >(2.2). Hm. Interesting solution, but I'm curious to know why it doesn't work just by itself. (I don't usually like solutions that involve macros. :-) Unless there's some reason for trn to trap characters like ^ before passing them to the shell, it seems like a bug to me. -- ____ Tim Pierce / "You are just naive and repressed because \ / twpierce@unix.amherst.edu / penis envy is here and it's now and it's \/ (BITnet: TWPIERCE@AMHERST) / all around you." -- Neal C. Wickham
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads