Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sunybcs!sybil.cs.Buffalo.EDU!kwon From: kwon@sybil.cs.Buffalo.EDU (Thomas Kwon) Newsgroups: comp.unix.questions Subject: using sed Message-ID: <14404@eerie.acsu.Buffalo.EDU> Date: 8 Dec 89 17:47:04 GMT Sender: nobody@acsu.buffalo.edu Lines: 24 I'm a novice hacker who is trying to use 'sed' to extract "certain string" of "certain column" of "certain line" of a result of a "certain command". Since that sounds too confusing, here is what I really mean. By typing 'ruptime' at the prompt, I get something like the following : antares up 21+04:15, 4 users, load 1.36, 1.50, 1.29 castor up 1+05:20, 0 users, load 0.00, 0.00, 0.00 deneb up 42+23:50, 0 users, load 0.00, 0.00, 0.00 gort up 14+14:47, 21 users, load 2.48, 1.77, 1.59 joey up 14+14:42, 2 users, load 0.00, 0.05, 0.26 marvin up 14+15:03, 10 users, load 1.43, 1.34, 1.12 sybil up 14+11:28, 33 users, load 2.83, 2.93, 2.44 wolf up 70+20:41, 0 users, load 1.46, 1.49, 1.28 I want to extract the string "1.34" which is in "column 8" of "line 6" and set that to a variable. How can this be done? So far, I've been experimenting with : set string=`ruptime|sed ` Any help will be greatly appreciated. Tom Kwon. *-)