Path: utzoo!mnetor!uunet!mcvax!ukc!reading!onion!riddle!domo From: domo@riddle.UUCP (Dominic Dunlop) Newsgroups: comp.unix.xenix Subject: Re: cut on xenix? Message-ID: <560@riddle.UUCP> Date: 29 Jan 88 11:18:45 GMT References: <116@corum.UUCP> <9343@steinmetz.steinmetz.UUCP> Reply-To: domo@riddle.UUCP (Dominic Dunlop) Organization: Sphinx Ltd., Maidenhead, England Lines: 26 Keywords: what's it called? In article <116@corum.UUCP> root@corum.UUCP (System Administration) writes: >sigh... what is the equivalent function for "cut" on xenix? i have a bunch of >shell scripts that i ported over from a vax that has oodles of "cut"s in them. Strange. Cut's there on my XENIX (SCO 2.2.1 for the 80386), and I can't recall it having been missing in recent older versions. But anyway, if you've got awk, you can use that instead of cut: cut -f2-7 is the same as awk '{FS=OFS='\t'; print $1, $2, $4, $5, $6, $7}' cut -c2-7 is the same as awk '{print substr($0, 2, 7-2+1)}' Life gets slightly more interesting in the general case (-d: -f1-9,11,13-). If you wanted to get flashy, writing a shell script -- or awk program -- to convert uses of cut to uses of awk wouldn't be too difficult. But I'm not volunteering... If you're really desperate, you can use sed to isolate parts of lines. For example cut -c2-7 is the same as sed 's/^.\(......\).*$/\1/' cut -f2-7 is the same as something possible, but very longwinded -- Dominic Dunlop domo@sphinx.co.uk domo@riddle.uucp