mrry (Happy New Year)
 
Blog Can You Tell What It Is Yet? 18/Oct/2004

The first sign of madness is writing shell commands like this:

grep "Unicast" `find -name "*.java"` \
  | sed "s/\.java:.*$//g" \
  | sed "s/^\.\///g" \
  | sed "s/\//\./g" \
  | uniq \
  | xargs rmic

There are no prizes for guessing what this does, though there would be much kudos for suggesting a better method. I predict that kudos goes to Stu.

Cheers,

Derek.

 
CommentsComments 

Fiona Cassidy said:
Ok I do have no idea what that means. Guess I'll find out when I reach 3rd year eh! :-)

Derek said:
Hrm, at the moment, I'd be angling for this as state of the art:

grep -l "Unicast" `find -name "*.java"` | sed -e "s/\.java$//g" -e "s/^\.\///g" -e "s/\//\./g" | xargs rmic

Perhaps not the most efficient, but possibly the most terse, fewest processes, and (arguably) easiest to debug.

Cheers,

Derek.

LaTeX lOvEr said:
Oh, and that LaTeX word count for emacs. Elisp for ~/.emacs:

(defun tex-word-count nil "Count words in buffer" (interactive)
(shell-command-on-region (point-min) (point-max) "detex | wc -w"))

Then 'Alt-x tex-word-count'. Assuming working detex, which the lab machines do.

Stoobe said:
Well not quite;

grep -l "Unicast" `find . -name "*.java"` | rev | cut -d'.' -f 2- | rev | cut -b 3- | tr '/' '.' | xargs rmic

Hrm. There must be a better way...

xargs r0x0rz j00 said:
grep -l -R "Unicast" `find . -name "*.java"` | rev | cut -d'.' -f 2- | rev | xargs rmic

Name

E-Mail

Url

Comment

Please enter the number 8563 in the box below:

 
CommentsTell a friend about this page

Your Name

Your E-Mail

Your friend's E-Mail

 
SideboardSideboard


< # Scottish Blogs ? >
Technorati Profile
Listed on BlogShares

Subscribe to the mrry RSS feed
More about RSS.
Trackback URL for this article:
http://www.mrry.co.uk/trackback/1825