|
|
Patch Set 1 #
Total comments: 11
Patch Set 2 : incorporate Russ' suggestions #
Total comments: 2
Patch Set 3 : clean up options and unneeded code #
Total comments: 10
Patch Set 4 : style, first option command #Patch Set 5 : handle options? really? never would have guessed #
Total comments: 12
Patch Set 6 : TMPDIR, no wq #Patch Set 7 : add start range ',' if one command w/o -e #Patch Set 8 : cosmetic code formatting #
Total comments: 8
Patch Set 9 : first draft from sed.1 #
Total comments: 15
Patch Set 10 : bin/vary - apply sam script to create a new file #Patch Set 11 : review comments #
Total comments: 1
Patch Set 12 : bin/ssam: default range with k #
Total comments: 1
Patch Set 13 : word freq example; many-echo style #
Total comments: 1
Patch Set 14 : one-word-per-line example uses y and c #Patch Set 15 : trivial \n to \en in man page source #
Total comments: 8
Patch Set 16 : start selection, *.ms, word freq #
Total comments: 2
Patch Set 17 : describe word freq example #Patch Set 18 : provide both ssam and man page to codereview #MessagesTotal messages: 49
http://codereview.appspot.com/95076/diff/1/2 File bin/ssam (right): http://codereview.appspot.com/95076/diff/1/2#newcode4 Line 4: me=ssam replace $me throughout with ssam. http://codereview.appspot.com/95076/diff/1/2#newcode9 Line 9: Route all output to stdout. Ignore -n. Executes commands from -f''s new line for each argument http://codereview.appspot.com/95076/diff/1/2#newcode18 Line 18: # only send home a gripe unnecessary. put a note in the docs if you want people to send email. http://codereview.appspot.com/95076/diff/1/2#newcode28 Line 28: # handle (no) input file This sequence would be simpler as tmp=/tmp/ssam.tmp.$USER.$pid cat $* >$tmp http://codereview.appspot.com/95076/diff/1/2#newcode39 Line 39: # do nothing with n since sam only prints on command This is a bit odd. Seems like you'd want to do something like { if(! ~ $#flagf 0) cat $flagf if(! ~ $#flage 0) echo $flage echo wq } | sam -d $tmp >[2]/dev/null if(! ~ $#flagn 0) cat $tmp
Sign in to reply to this message.
Rewrote most actual functionality to incorporate Russ' suggestions. Will upload new version. http://codereview.appspot.com/95076/diff/1/2 File bin/ssam (right): http://codereview.appspot.com/95076/diff/1/2#newcode4 Line 4: me=ssam On 2009/07/25 19:22:01, rsc wrote: > replace $me throughout with ssam. > Done. http://codereview.appspot.com/95076/diff/1/2#newcode9 Line 9: Route all output to stdout. Ignore -n. Executes commands from -f''s On 2009/07/25 19:22:01, rsc wrote: > new line for each argument > Done. http://codereview.appspot.com/95076/diff/1/2#newcode18 Line 18: # only send home a gripe On 2009/07/25 19:22:01, rsc wrote: > unnecessary. put a note in the > docs if you want people to send email. > Done. http://codereview.appspot.com/95076/diff/1/2#newcode28 Line 28: # handle (no) input file On 2009/07/25 19:22:01, rsc wrote: > This sequence would be simpler as > > tmp=/tmp/ssam.tmp.$USER.$pid > cat $* >$tmp > Done. http://codereview.appspot.com/95076/diff/1/2#newcode39 Line 39: # do nothing with n since sam only prints on command Your !-n prints the entire file no matter what, after all the lines explicitly printed. sed's !-n prints all lines, but intersperses them with the corresponding edited line. sam only prints on command, unlike sed which by default prints everything. It's less inportant to me to mimic this sed behavior, since the sam user can easily add ,p to print everything. So I will exclude the -n option completely for now, since I don't think the sam user needs it, and sed scripts are only weakly portable to sam. http://codereview.appspot.com/95076/diff/1/2#newcode39 Line 39: # do nothing with n since sam only prints on command On 2009/07/25 19:22:01, rsc wrote: > This is a bit odd. Seems like you'd want to do > something like > > { > if(! ~ $#flagf 0) cat $flagf > if(! ~ $#flage 0) echo $flage > echo wq > } | sam -d $tmp >[2]/dev/null > > if(! ~ $#flagn 0) cat $tmp > > Done, except flagn line.
Sign in to reply to this message.
http://codereview.appspot.com/95076/diff/3002/1003 File bin/ssam (right): http://codereview.appspot.com/95076/diff/3002/1003#newcode29 Line 29: if(! ~ $#flagn 0) cat $tmp Why did you delete the -n flag? I think that's pretty useful. http://codereview.appspot.com/95076/diff/1005/3003#newcode7 Line 7: flagfmt='h,n,f file,e command,G gripe' flagfmt='n,e script,f sfile' (matches sed(1)) http://codereview.appspot.com/95076/diff/1005/3003#newcode8 Line 8: args='[infile] args='[ file ... ]' is fine. the rest belongs in the man page. http://codereview.appspot.com/95076/diff/1005/3003#newcode14 Line 14: If no input file, take input from standard input.' s/ || ~$flagh 1// no need for the explicit -h because typing ssam -? will be treated like an invalid option and print the usage anyway http://codereview.appspot.com/95076/diff/1005/3003#newcode18 Line 18: } sed has a nice feature where if you don't say -e or -f then the first argument is the command sed 10q file.c for example to do this here i think you'd do if(~ $#flage 0 && ~ $#flagf 0) { if(~ $#* 0) { usage exit usage } flage=$1 shift } http://codereview.appspot.com/95076/diff/1005/3003#newcode23 Line 23: { looking good. please use a single tab instead of two spaces for the indentation same above in the usage message.
Sign in to reply to this message.
i think you're pretty close to done here. i hope you haven't given up.
Sign in to reply to this message.
Not at all! I've been thinking about what you suggested (especially -n), and writing another tool (vary) on top of ssam. It takes a sam script and a file (data, makefile, rc script), applies the sam script to the file, and either prints the name of the new file or executes it. It's kind of a ghetto form of aspect-oriented programming, where you have a simple base script, and then instead of including all the various possible control paths with if statements, you use sam scripts to actually edit the script and create a new one.
Sign in to reply to this message.
http://codereview.appspot.com/95076/diff/3002/1003 File bin/ssam (right): http://codereview.appspot.com/95076/diff/3002/1003#newcode29 Line 29: if(! ~ $#flagn 0) cat $tmp On 2009/08/08 20:38:06, rsc wrote: > Why did you delete the -n flag? > I think that's pretty useful. I figured out a way to make -n provide value. If set, I add "echo ,p" just before "echo wq", so the sam script passed in does not have to print any output itself.
Sign in to reply to this message.
On 2009/08/17 01:12:20, jdc wrote: > http://codereview.appspot.com/95076/diff/3002/1003 > File bin/ssam (right): > > http://codereview.appspot.com/95076/diff/3002/1003#newcode29 > Line 29: if(! ~ $#flagn 0) cat $tmp > On 2009/08/08 20:38:06, rsc wrote: > > Why did you delete the -n flag? > > I think that's pretty useful. > > I figured out a way to make -n provide value. If set, I add "echo ,p" just > before "echo wq", so the sam script passed in does not have to print any output > itself. Maybe I should invert that sense, to make it print with an extra ,p at the end, unless -n is supplied. This would make it closer to sed, in which -n means "print nothing unless specifically asked".
Sign in to reply to this message.
Updated ssam with your suggestions. I use the first-argument-as-command feature of sed all the time, so thanks much for the code sample and detail about no -f and -e. Haven't started a man page for ssam yet. I have written man pages in the past, so I'm familiar enough with them to have no excuse. I think I'll use the man page for sed as a base, and mash it up with references to sam's command language rather than sed's. http://codereview.appspot.com/95076/diff/1005/3003 File bin/ssam (right): http://codereview.appspot.com/95076/diff/1005/3003#newcode7 Line 7: flagfmt='h,f file,e command' On 2009/08/08 20:38:06, rsc wrote: > flagfmt='n,e script,f sfile' > > (matches sed(1)) > Done. http://codereview.appspot.com/95076/diff/1005/3003#newcode8 Line 8: args='[infile] On 2009/08/08 20:38:06, rsc wrote: > args='[ file ... ]' > is fine. the rest belongs in the man page. > Done. http://codereview.appspot.com/95076/diff/1005/3003#newcode14 Line 14: if(! ifs=() eval `{getflags $*} || ~ $flagh 1){ On 2009/08/08 20:38:06, rsc wrote: > s/ || ~$flagh 1// > > no need for the explicit -h because typing > ssam -? > will be treated like an invalid option > and print the usage anyway > Done. http://codereview.appspot.com/95076/diff/1005/3003#newcode18 Line 18: On 2009/08/08 20:38:06, rsc wrote: > sed has a nice feature where if you don't say -e or -f > then the first argument is the command > > sed 10q file.c > > for example > > to do this here i think you'd do > > if(~ $#flage 0 && ~ $#flagf 0) { > if(~ $#* 0) { > usage > exit usage > } > flage=$1 > shift > } > > Done. http://codereview.appspot.com/95076/diff/1005/3003#newcode23 Line 23: if(! ~ $#flagf 0) cat $flagf On 2009/08/08 20:38:06, rsc wrote: > looking good. > please use a single tab > instead of two spaces for the indentation > same above in the usage message. > Done.
Sign in to reply to this message.
looks great. let's move on to the man page. http://codereview.appspot.com/95076/diff/5004/5005 File bin/ssam (right): http://codereview.appspot.com/95076/diff/5004/5005#newcode3 Line 3: # send problems to Jason.Catena@gmail.com I like the sentiment, but I don't like hard-coding email addresses. Maybe now that there is an issue tracker it suffices to watch the issues, which I assume you are doing anyway? http://codereview.appspot.com/95076/diff/5004/5005#newcode22 Line 22: tmp=/tmp/ssam.tmp.$USER.$pid in unix it is customary to use $TMPDIR if(~ $#TMPDIR 0) TMPDIR=/tmp tmp=$TMPDIR/ssam.tmp.$USER.$pid http://codereview.appspot.com/95076/diff/5004/5005#newcode26 Line 26: if(! ~ $#flagf 0) cat $flagf not that it should ever happen but i'd put these in the same order they are in the usage: first flage then flagf. sed does them in the order they appear on the command line but getflags gives no way to do that http://codereview.appspot.com/95076/diff/5004/5005#newcode29 Line 29: echo wq no need for w; also no need for q; delete this line http://codereview.appspot.com/95076/diff/5004/5005#newcode30 Line 30: } | sam -d $tmp >[2]/dev/null it may be worth |[2] egrep -v '^ -\. |^\?changed files' >[1=2] so that except for the -. /tmp/ssam.*.$USER.$pid and the ?changed files at the end, sam error messages are still shown on standard error.
Sign in to reply to this message.
http://codereview.appspot.com/95076/diff/5004/5005 File bin/ssam (right): http://codereview.appspot.com/95076/diff/5004/5005#newcode25 Line 25: { i wonder if this block should start with echo , so that the commands begin executing with the whole input selected. that seems more useful than starting at 0 and is easy to override.
Sign in to reply to this message.
Did some changes, but have issues with two of them, and an idea for another. http://codereview.appspot.com/95076/diff/5004/5005 File bin/ssam (right): http://codereview.appspot.com/95076/diff/5004/5005#newcode3 Line 3: # send problems to Jason.Catena@gmail.com On 2009/08/18 05:48:15, rsc wrote: > I like the sentiment, but I don't like hard-coding email addresses. > Maybe now that there is an issue tracker it suffices to watch > the issues, which I assume you are doing anyway? How about this instead? # log issues to http://codereview.appspot.com/95076/show http://codereview.appspot.com/95076/diff/5004/5005#newcode22 Line 22: tmp=/tmp/ssam.tmp.$USER.$pid On 2009/08/18 05:48:15, rsc wrote: > in unix it is customary to use $TMPDIR > if(~ $#TMPDIR 0) > TMPDIR=/tmp > tmp=$TMPDIR/ssam.tmp.$USER.$pid > Done. http://codereview.appspot.com/95076/diff/5004/5005#newcode25 Line 25: { On 2009/08/18 06:32:40, rsc wrote: > i wonder if this block should start with > > echo , > > so that the commands begin executing > with the whole input selected. > that seems more useful than starting at 0 > and is easy to override. I seem to get an extra print of the entire input file. Maybe it assumes "," means "0,$p"? As intended, the first command does not need to specify its range. But that makes the first command different than all the others. If someone uses this feature but then changes the order of commands---without adjusting which lines specify a range---the script will quietly fail. The old first command will not run, since it selects no range. I think it would be better for both these reasons not to put in this change. http://codereview.appspot.com/95076/diff/5004/5005#newcode26 Line 26: if(! ~ $#flagf 0) cat $flagf On 2009/08/18 05:48:15, rsc wrote: > not that it should ever happen but i'd put these > in the same order they are in the usage: first flage then flagf. > sed does them in the order they appear on the command line > but getflags gives no way to do that Before getflags mangles $* we could do this: if(echo $* | grep '.*-e.*-f') orderef=ef if(echo $* | grep '.*-f.*-e') orderef=fe I specifically chose to apply the file first, before the command line. Usually -e commands are more ephemeral, and often are commands under test that could go into the file for storage. So I apply them last, for the use case where they massage the output of a script file. http://codereview.appspot.com/95076/diff/5004/5005#newcode29 Line 29: echo wq On 2009/08/18 05:48:15, rsc wrote: > no need for w; > also no need for q; > delete this line > Done. http://codereview.appspot.com/95076/diff/5004/5005#newcode30 Line 30: } | sam -d $tmp >[2]/dev/null On 2009/08/18 05:48:15, rsc wrote: > it may be worth > |[2] egrep -v '^ -\. |^\?changed files' >[1=2] > so that except for the > -. /tmp/ssam.*.$USER.$pid > and the > ?changed files > at the end, sam error messages are still shown > on standard error. Agree with the idea, but this implementation produces this error: ?bad delimiter `s' ?bad delimiter `s' ?bad delimiter `a'
Sign in to reply to this message.
description of vary: Apply a sam script (a file with the suffix ".sam") to a file to create a new file. The name of the new file is the name of the old file catenated with a new suffix. The new suffix is the name of the sam file without its path or ".sam" suffix. -v adds, as the second line in the file, a new line which sets the shell variable or make macro "variant" to the new suffix. -x runs the new file. If the user supplies any command options, vary passes these along when it executes the new file as a command.
Sign in to reply to this message.
let's leave vary out for now; it can go into a different issue #
Sign in to reply to this message.
http://codereview.appspot.com/95076/diff/9004/8006 File man/man1/ssam.1 (right): http://codereview.appspot.com/95076/diff/9004/8006#newcode40 Line 40: will prepend ',' to the command. will prefix the command with .L , . prepend does not have the meaning you are using here. it means to ponder something deeply. http://codereview.appspot.com/95076/diff/9004/8006#newcode43 Line 43: option suppresses the default output: the file in its entirety, after s/:.*//g and delete next line. http://codereview.appspot.com/95076/diff/9004/8006#newcode48 Line 48: .B ssam -n '10p' file ssam -n ,10p file no need for quotes. note comma http://codereview.appspot.com/95076/diff/9004/8006#newcode51 Line 51: .B ssam 's,\en\en,\en,g' more conventional to use / for separator. ssam 's/^\n//g' http://codereview.appspot.com/95076/diff/9004/8006#newcode54 Line 54: .B ssam 's,UNIX,& system,g' s/UNIX/& system/g http://codereview.appspot.com/95076/diff/9004/8006#newcode66 Line 66: L. E. McMahon, delete the sed(1) reference is enough http://codereview.appspot.com/95076/diff/9004/8006#newcode73 Line 73: If input is from a pipe, buffering may consume delete current bug. add Ssam consumes all of standard input before running the script.
Sign in to reply to this message.
Let's make these changes to ssam and the manual and then get that added. vary can happen in another CL. http://codereview.appspot.com/95076/diff/8004/9002 File bin/ssam (right): http://codereview.appspot.com/95076/diff/8004/9002#newcode18 Line 18: start=, I think this behavior is a mistake: it shouldn't matter whether the user said -e or -f or whatever. Instead, it is possible (though not obvious how) to start with the entire file as the current selection. See below. http://codereview.appspot.com/95076/diff/8004/9002#newcode23 Line 23: if(~ $#TMPDIR 0) TMPDIR=/tmp please split into two lines http://codereview.appspot.com/95076/diff/8004/9002#newcode28 Line 28: if(! ~ $#start 0) echo -n $start Selecting everything without printing it is tricky, but this seems to work: # select entire file echo ',{' echo k echo '}' echo '0k' # run scripts, print if(! ~ $#flagf 0) cat $flagf if(! ~ $#flage 0) echo $flage if(~ $#flagn 0) echo , http://codereview.appspot.com/95076/diff/8004/9002#newcode34 Line 34: rm $TMPDIR/ssam.*.$USER.$pid let's make this rm -f $tmp (i.e. drop the wildcard) just to be safe.
Sign in to reply to this message.
http://codereview.appspot.com/95076/diff/9004/8006 File man/man1/ssam.1 (right): http://codereview.appspot.com/95076/diff/9004/8006#newcode40 Line 40: will prepend ',' to the command. On 2009/09/10 05:15:42, rsc. wrote: > prepend does not have the meaning you are using here. > it means to ponder something deeply. The first three Google results on the word prepend refer to online dictionary entries which match precisely my meaning, and use computing references. > will prefix the command with > .L , . If I mention the command first then "prefix" probably fits the flow better, but I want to focus the sentence on the comma rather than the command. http://codereview.appspot.com/95076/diff/9004/8006#newcode43 Line 43: option suppresses the default output: the file in its entirety, after On 2009/09/10 05:15:42, rsc. wrote: > s/:.*//g and delete next line. Done, but why not be more specific? It is just patently obvious? http://codereview.appspot.com/95076/diff/9004/8006#newcode48 Line 48: .B ssam -n '10p' file On 2009/09/10 05:15:42, rsc. wrote: > ssam -n ,10p file > > no need for quotes. Done. > note comma Still wondering about the best way to handle this. I don't think that ssam should select the entire file when it starts in all cases. If it did, then the first command in the sam script would have to know that it is the first command, and the remaining commands would have to know they are not the first. Programs that generate a sam script would have to keep track of which line was first output. If I know I only have one command (ie, two or more arguments, but no -e or -f), then I could generate the comma to save the user a keystroke and preserve a bit of compatibility with sed. But there's something in forcing the user to remember the sam range selector in even the simplest commands, since it's a significant difference from sed. http://codereview.appspot.com/95076/diff/9004/8006#newcode51 Line 51: .B ssam 's,\en\en,\en,g' On 2009/09/10 05:15:42, rsc. wrote: > more conventional to use / for separator. Done. > ssam 's/^\n//g' Doesn't remove the blank lines. I think sam's ^ only refers to the beginning of the file or range. http://codereview.appspot.com/95076/diff/9004/8006#newcode54 Line 54: .B ssam 's,UNIX,& system,g' On 2009/09/10 05:15:42, rsc. wrote: > s/UNIX/& system/g > Done. http://codereview.appspot.com/95076/diff/9004/8006#newcode66 Line 66: L. E. McMahon, On 2009/09/10 05:15:42, rsc. wrote: > delete > the sed(1) reference is enough > Done. http://codereview.appspot.com/95076/diff/9004/8006#newcode73 Line 73: If input is from a pipe, buffering may consume On 2009/09/10 05:15:42, rsc. wrote: > delete current bug. > add > > Ssam consumes all of standard input before > running the script. > > Done.
Sign in to reply to this message.
http://codereview.appspot.com/95076/diff/9004/8006 File man/man1/ssam.1 (right): http://codereview.appspot.com/95076/diff/9004/8006#newcode48 Line 48: .B ssam -n '10p' file There's a difference between starting the command with a , and starting with , as the current value of dot. If you do it by smashing a , at the beginning, then something like sam 3,5p or even ,p fails mysteriously. If you set dot before executing the command, then these work just fine. I think it is totally fine to say "the script starts executing with . (dot) set to the entire file contents." It's a nice convenience and easy to explain. http://codereview.appspot.com/95076/diff/9009/8015#newcode40 Line 40: will prepend ',' to the command. I'd rather not argue: it's commonly used but still not a real word. The whole point is moot since my comment on the script changed the semantics here anyway.
Sign in to reply to this message.
I guess the effect of the 'k' lines is to select the entire range, for first commands without ',', while also allowing the user to provide a range if he likes? http://codereview.appspot.com/95076/diff/8004/9002 File bin/ssam (right): http://codereview.appspot.com/95076/diff/8004/9002#newcode18 Line 18: start=, On 2009/09/10 05:27:17, rsc wrote: > I think this behavior is a mistake: it shouldn't > matter whether the user said -e or -f or whatever. > Instead, it is possible (though not obvious how) > to start with the entire file as the current selection. > > See below. > Done. http://codereview.appspot.com/95076/diff/8004/9002#newcode23 Line 23: if(~ $#TMPDIR 0) TMPDIR=/tmp On 2009/09/10 05:27:17, rsc wrote: > please split into two lines > Done. http://codereview.appspot.com/95076/diff/8004/9002#newcode28 Line 28: if(! ~ $#start 0) echo -n $start On 2009/09/10 05:27:17, rsc wrote: > Selecting everything without printing it is tricky, but this seems to work: > > # select entire file > echo ',{' > echo k > echo '}' > echo '0k' > > # run scripts, print > if(! ~ $#flagf 0) > cat $flagf > if(! ~ $#flage 0) > echo $flage > if(~ $#flagn 0) > echo , > Done. http://codereview.appspot.com/95076/diff/8004/9002#newcode34 Line 34: rm $TMPDIR/ssam.*.$USER.$pid On 2009/09/10 05:27:17, rsc wrote: > let's make this rm -f $tmp > (i.e. drop the wildcard) > just to be safe. > Done.
Sign in to reply to this message.
When you reupload, please be sure to upload both ssam and ssam.1 http://codereview.appspot.com/95076/diff/9013/9014 File bin/ssam (right): http://codereview.appspot.com/95076/diff/9013/9014#newcode29 Line 29: echo ',{ Please make this 4 different echos to avoid the weird-looking spacing. echo ',{' echo k echo '}' echo 0k or else move it up outside the { } cat $* >$tmp selectall=',{ k } 0k' # select entire file echo $selectall
Sign in to reply to this message.
http://codereview.appspot.com/95076/diff/10004/9018 File man/man1/ssam.1 (right): http://codereview.appspot.com/95076/diff/10004/9018#newcode49 Line 49: .B ssam 's,[^A-Za-z],\n,g' file Nice example. Let's use something other than s. Please use slashes so that the deviation from convention doesn't distract from the content. ssam 'y/[a-zA-Z]+/ c/\n/' file
Sign in to reply to this message.
please fix these and upload ssam with it and then we can apply this. http://codereview.appspot.com/95076/diff/10008/9029 File man/man1/ssam.1 (right): http://codereview.appspot.com/95076/diff/10008/9029#newcode28 Line 28: begins with the entire file selected for the first command. When the script starts, the entire input is selected. http://codereview.appspot.com/95076/diff/10008/9029#newcode47 Line 47: Print the first 10 lines of the file. s/the // http://codereview.appspot.com/95076/diff/10008/9029#newcode49 Line 49: .B ssam 'y/[a-zA-Z]+/ c/\en/' file s/file/*.ms/ http://codereview.appspot.com/95076/diff/10008/9029#newcode61 Line 61: .B Count frequency of words in stdin. Let's get this onto one line to avoid having to reformat the entire section. ssam 'y/[a-zA-Z]+/ c/\en/' | grep . | sort | uniq -c No need for sort -n -- leave sorted by word.
Sign in to reply to this message.
http://codereview.appspot.com/95076/diff/10008/9029 File man/man1/ssam.1 (right): http://codereview.appspot.com/95076/diff/10008/9029#newcode28 Line 28: begins with the entire file selected for the first command. On 2009/09/15 16:30:59, rsc wrote: > When the script starts, the entire input is selected. > Done. http://codereview.appspot.com/95076/diff/10008/9029#newcode47 Line 47: Print the first 10 lines of the file. On 2009/09/15 16:30:59, rsc wrote: > s/the // > Done. http://codereview.appspot.com/95076/diff/10008/9029#newcode49 Line 49: .B ssam 'y/[a-zA-Z]+/ c/\en/' file On 2009/09/15 16:30:59, rsc wrote: > s/file/*.ms/ Done. Isn't this a little *roff-specific? I take notes in plain text files, for example, and use *.tex (latex) and *.nw (noweb) files for documents. Of all the command man pages, only grep.1 lists *.ms along with the other types of files searched by -G. http://codereview.appspot.com/95076/diff/10008/9029#newcode61 Line 61: .B Count frequency of words in stdin. On 2009/09/15 16:30:59, rsc wrote: > Let's get this onto one line to avoid > having to reformat the entire section. > > ssam 'y/[a-zA-Z]+/ c/\en/' | grep . | sort | uniq -c > > No need for sort -n -- leave sorted by word. > Done. In /man/ssam(1) this gets cut off after the grep .
Sign in to reply to this message.
Are you giving codereview bin/ssam too? It isn't showing up on the review screen from codereview.appspot.com, but maybe that is a bug in the uploader or in the appspot server. http://codereview.appspot.com/95076/diff/10010/9033 File man/man1/ssam.1 (right): http://codereview.appspot.com/95076/diff/10010/9033#newcode61 Line 61: Count frequency of words in stdin. words read from standard input.
Sign in to reply to this message.
this looks fine but ssam is still missing. you didn't answer my question: are you passing ssam to codereview?
Sign in to reply to this message.
Uploaded both files. I hadn't uploaded bin/ssam for a few since there wasn't a change. But since that's not apparent unless you see the change set, I'll upload both from now on. How would I take vary out of this patch set? http://codereview.appspot.com/95076/diff/10010/9033 File man/man1/ssam.1 (right): http://codereview.appspot.com/95076/diff/10010/9033#newcode61 Line 61: Count frequency of words in stdin. On 2009/09/15 20:13:27, rsc wrote: > words read from standard input. > Done.
Sign in to reply to this message.
vary is gone by virtue of your not including it in the most recent patch that you submitted. codebot: apply ssam(1): new command
Sign in to reply to this message.
# codebot: apply codebot error: unknown full name for jdc <jason.catena@gmail.com> jdc, please add a note to this issue with "codebot: name Your Full Name" on a line by itself without the quotes. thanks. codebot Return-Path: <3Xx6wSgMJB3gnoYospYd.YkiYkZaXkpnoY.ospYd.Yki@apphosting.bounces.google.com> Received-SPF: Pass; receiver=holo.morphisms.net; client-ip=209.85.132.188; Date: Tue, 15 Sep 2009 23:08:15 +0000 Subject: Re: man/man1/ssam.1 review comments From: rsc@swtch.com vary is gone by virtue of your not including it in the most recent patch that you submitted. codebot: apply ssam(1): new command http://codereview.appspot.com/95076
Sign in to reply to this message.
codebot: apply ssam(1): new command
Sign in to reply to this message.
# codebot: apply applied.
Sign in to reply to this message.
Thanks! Should I see both files on the commit page? Only the man page seems there.
Sign in to reply to this message.
On 2009/09/15 23:27:33, jdc wrote: > Thanks! Should I see both files on the commit page? Only the man page seems > there. whoops; fixed
Sign in to reply to this message.
|