Re: awk question, maybe
# [EMAIL PROTECTED] / 2003-12-15 16:30:33 -0700: i would like to do something like df | awk '{print $1}' to capture all the current file systems. But I would like to strip off the first and last lines, since these are generally -- not needed. the goal is to write a generalized script that can feed dump with all the file systems on a box. I would use mount(8) instead: its output doesn't include any headers, but you'll still want to pass through only local filesystems, so it doesn't really matter: [EMAIL PROTECTED] ~ 1006:0 mount | awk '/\/dev\/(ad|da)/ {print $1}' /dev/ad0s1a /dev/ad0s1e [EMAIL PROTECTED] ~ 1007:0 df | awk '/\/dev\/(ad|da)/ {print $1}' /dev/ad0s1a /dev/ad0s1e -- If you cc me or remove the list(s) completely I'll most likely ignore your message.see http://www.eyrie.org./~eagle/faqs/questions.html ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: awk question, maybe
man head and man tail At 05:30 PM 12/15/2003, you wrote: i would like to do something like df | awk '{print $1}' to capture all the current file systems. But I would like to strip off the first and last lines, since these are generally -- not needed. the goal is to write a generalized script that can feed dump with all the file systems on a box. any pointers? -- David Bear phone: 480-965-8257 fax:480-965-9189 College of Public Programs/ASU Wilson Hall 232 Tempe, AZ 85287-0803 Beware the IP portfolio, everyone will be suspect of trespassing ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.545 / Virus Database: 339 - Release Date: 11/27/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.545 / Virus Database: 339 - Release Date: 11/27/2003 ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
awk question, maybe
i would like to do something like df | awk '{print $1}' to capture all the current file systems. But I would like to strip off the first and last lines, since these are generally -- not needed. the goal is to write a generalized script that can feed dump with all the file systems on a box. any pointers? -- David Bear phone: 480-965-8257 fax:480-965-9189 College of Public Programs/ASU Wilson Hall 232 Tempe, AZ 85287-0803 Beware the IP portfolio, everyone will be suspect of trespassing ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: awk question, maybe
On Mon, 15 Dec 2003, David Bear wrote: i would like to do something like df | awk '{print $1}' to capture all the current file systems. But I would like to strip off the first and last lines, since these are generally -- not needed. df | awk '$1 ~/^\/dev/ {print $1}' Fer ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: awk question, maybe
On Mon, Dec 15, 2003 at 08:39:06PM -0300, Fernando Gleiser wrote: On Mon, 15 Dec 2003, David Bear wrote: i would like to do something like df | awk '{print $1}' to capture all the current file systems. But I would like to strip off the first and last lines, since these are generally -- not needed. df | awk '$1 ~/^\/dev/ {print $1}' yes.. I was hoping it would be simple. and I thought of using a regex to match the lines I want after sending that note. thanks for all the replies. -- David Bear phone: 480-965-8257 fax:480-965-9189 College of Public Programs/ASU Wilson Hall 232 Tempe, AZ 85287-0803 Beware the IP portfolio, everyone will be suspect of trespassing ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]