Jump to content
Science Forums

Your favorite Linux command/program


Recommended Posts

actually this is an excellent one, so dont make the same mistake i did, of bothering to write your own prime factoring algorithm, it may be fast, but its not smart, referring to factor, its great, fast and excellent, whoever thought of putting it in, should told me, cuz i had to actually write not only a an extremely fast solution with bitmaps and a vector, but a recursive one too, so that first one could have ended in like 2 lines of code...

Link to comment
Share on other sites

ok, here's my cool little script for replacing versions of my .jar files in all config files and scripts:

 

#!/bin/sh

SCRIPTS=`find . -name "*.*" -exec grep -l "$1" {} ;`

for file in $SCRIPTS
do
       echo "Editing $file...";
       (cat $file; echo '') | sed 's/'$1'/'$2'/g' > ${file}.tmp;
       sleep 1;
       mv ${file}.tmp $file;
done;

 

oh, and by the way, here's a link to my unix shell scripting tutorial if anyone cares to check it out: http://www.dreamsyssoft.com/unix-shell-scripting/tutorial.php

Link to comment
Share on other sites

nope, I do, because i did not have to write a script and it does loads of stuff then blindfully replace stuff in config files, so pbttt I have a more powerful tool that i didnt have to write, and it is one line per execution, and therefore i win.

Actually have a patch for it that makes dispatch-conf a lot more powerful, friend wrote it, allows you to do real cool stuff...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...