#! /bin/sh # print only specified fields to stdout # # E.g.: # mailq | field 1 # ps uax | field 2 4 5 # (C) Copyright 2003 Rahul Dhesi, All rights reserved. # # "As is" -- No warranty. # # Copying, use, and modification are permitted, governed by # the GNU General Public License, by only those who agree # to use this program at their own risk. LIST="\$$1" if test $# -gt 1; then shift for field do LIST="$LIST, \$$field" done fi awk "{print $LIST}"