Recent

Author Topic: Cute Little Utility  (Read 4877 times)

thaimann

  • Jr. Member
  • **
  • Posts: 84
Cute Little Utility
« on: March 20, 2010, 05:09:58 pm »
I had never much looked into the UNIX programs cut or awk.  I had picked up the Linux Magazine with the 300 most used BASH Commands and read a little on it and I thought wouldn't it be nice if you could feed that directly into other commands.

Ex: Lets say any user who has a used id of 600 - 639 is a member of Accounting and lets also assume that the System Administrator had set each up in their own group (Don't laugh someone did this to us at work with a server set up to teach us Linux.)  So you could create a command file to go out and do this or using my program, do the following:

cat /etc/passwd | grep :6[0-3][0-9]: | cut -d: -f1 | ./MyPrg 'usermod -g 600 <var>'

I also have the option to use the -a switch, which will submit it all as a job to the At Facility.  I needed to do this in case there are pipes or redirects.  The program is written in Free Pascal and is under 200 lines of code.

Well, before I put this out on SourceForge or something I need a better name.  Right now it is just called cmdprg and I was wondering if anyone had a better idea.

Terry

davesimplewear

  • Sr. Member
  • ****
  • Posts: 321
    • Davids Freeware
Re: Cute Little Utility
« Reply #1 on: March 21, 2010, 10:46:36 am »
How about CLU for cute little utility (tongue in cheek ;))
All things considered insanity seems the best option

thaimann

  • Jr. Member
  • **
  • Posts: 84
Re: Cute Little Utility
« Reply #2 on: March 22, 2010, 04:27:39 pm »
This has been submitted to SourceForge under the name "rerun"

 

TinyPortal © 2005-2018