SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i like grep... nothing wrong with using it. and there are many other uses for grep instead of using it along with awk, so your thread title could be very misleading to others reading.
surely you know how to use something as trivial as cut???
grep pattern file | cut -f 1
ok, yes you'll use two processes... erm.. and?? it's not like there is a world shortage of processes. the 0.2 second execution time is hardly gonna impact anything is it?
Originally posted by acid_kewpie ok, yes you'll use two processes... erm.. and?? it's not like there is a world shortage of processes. the 0.2 second execution time is hardly gonna impact anything is it?
This assumption is good if it's your personal machine and you're not offering public services. If you're running a website based on php and your php code calls this kind of thing everytime you get a hit, and you're getting a couple hundred hits a second, you're probably looking for a better way to do it
I like vfs's way of thinking, ie looking for a way to do it in just one process. I do think his thread title is misleading. I said "What!?!?!?" when I read it and had to find out just why such a rash thing would be said
Who says grep isn't more efficient at searching for things then then the none grep example? I would rather use 2 processes that take .2s then one that takes .4 and does the same job...
You have to look at the whole equation, number of process, about of time per process, amount of memory used... then you have to weight the options to see what is better for you.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.