🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #20

Re: Need script to find root of filename

#20
From: Tom Christiansen
Date: Thu, 29 Oct 1992 17:10
19 lines
1431 bytes
From the keyboard of ccsam004@othello.ucdavis.edu (Brian C Hill):
:	#!/usr/bin/ksh	(or wherver you ksh is)
:	for i in *.[0-9]* ; do
:		mv $i ${i%.*}
:	done

:	No long syntactical nightmares, no contracting out of string
:processing services to separate awk, basename, sed, cut and/or other 
:processes, only 3 lines and fast! Good work ksh.

Bah.  The % and # hacks are as much syntactic nightmares as csh's :r
and allies.

--tom
-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist

	    "AT&T -- anything better is illegal."
		  -- Keith Lofstrom, comp.unix.bsd, "AT&T sues BSDI" thread
Technical Details
Message-ID: <1992Oct29.171019.2058@news.eng.convex.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!ames!sun-barr!cs.utexas.edu!convex!convex!tchrist
References: <18540@ucdavis.ucdavis.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.unix.shell
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!ames!sun-barr!cs.utexas.edu!convex!convex!tchrist
From: Tom Christiansen <tchrist@convex.COM>
Subject: Re: Need script to find root of filename
Originator: tchrist@pixel.convex.com
Sender: usenet@news.eng.convex.com (news access account)
Message-ID: <1992Oct29.171019.2058@news.eng.convex.com>
Date: Thu, 29 Oct 1992 17:10:19 GMT
Reply-To: tchrist@convex.COM (Tom Christiansen)
References: <18540@ucdavis.ucdavis.edu>
Nntp-Posting-Host: pixel.convex.com
Organization: Convex Computer Corporation, Colorado Springs, CO
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.
Lines: 19