[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: batch renaming
On Wed, 1 Mar 2000, Gaal Yahas wrote:
> On Tue, Feb 29, 2000 at 08:30:41PM +0200, Ariel Biener wrote:
>
> > shell scripts, and doing:
> >
Ok, so make: it ls -1 *.for|awk -F'.for$' '{print "mv "$0" "$1".f"}'|sh
if you don't have a POSIX system, or:
ls -1 *.for|awk -F'.for$' '{system("mv "$0" "$1".f")}'
if you do.
--Ariel
>
> Won't work for filenames with more than one '.' in them:
>
> $ echo "example.what.for" | awk -F"." '{print "mv "$0" "$1".f"}'
> mv example.what.for example.f
>
> (Also, even awouchk has a system() function which can be used to
> save us from the sh here.)
>
> --
> believing is seeing
> gaal@forum2.org
> http://www.forum2.org/gaal/
>
> =================================================================
> To unsubscribe, send mail to linux-il-request@linux.org.il with
> the word "unsubscribe" in the message body, e.g., run the command
> echo unsubscribe | mail linux-il-request@linux.org.il
>
--
Ariel Biener
e-mail: ariel@post.tau.ac.il Work phone: 03-6406086
fingerprint = 07 D1 E5 3E EF 6D E5 82 0B E9 21 D4 3C 7D 8B BC
=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il