Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 07 Mar 2005 17:40:18 +0100
From:      Frank de Bot <freebsd@searchy.nl>
To:        freebsd-questions@freebsd.org
Subject:   Re: Help Renaming Multple Files
Message-ID:  <422C83F2.8040707@searchy.nl>
In-Reply-To: <c3ed3fdc050307083572c03627@mail.gmail.com>
References:  <c3ed3fdc050307083572c03627@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
for files in `ls`;do newfile=`echo $files | sed "s|^reports_||g"`;mv 
$files $newfile;done

it's unproved code at the moment, but it gives an idea how to do it.



Phusion wrote:
> I need help figuring out how to rename multple files. The files are
> named like reports_abcdef_YYYYMMDD.dat, reports_hijklm_YYYYMMDD.dat,
> and reports_nopqrs_YYYYMMDD.dat. Here is an example.
> 
> Original Filename: reports_abcdef_YYYYMMDD.dat
> New Filename: abcdef_YYYYMMDD.dat
> 
> Let me know how I can do this. Thanks.
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?422C83F2.8040707>