Summary: Multiple name changes

From: SolarisSys@netscape.net
Date: Wed Jul 09 2003 - 10:10:19 EDT


First, I would like to apologize for posting such a simple question to the board. I understand the policies and I did not research my issue well enough. Below are all the responses I got, in particular, the first link that was provided that offers a great deal of info and would of answered my question if I searched correctly.

Thank you again to everyone who replied with answers and advice to helping me with this.

Thanks,

Paul

 - If you do not have something nice to say, do not say it at all.
 - Manners will get you further then rudeness.

http://www.faqs.org/faqs/unix-faq/faq/part2/

--------------------------------------------------------------------------------------------

#!/bin/sh
for i in *.jad
do
   mv $i `echo $i | sed 's/jad$/java/'`
done

>---------------------------------------------------------------------------------------------

perl -e "foreach (glob('./*.jad')) { s/\.jad$//; `mv $_.jad $_.java`;}"

>---------------------------------------------------------------------------------------------
#################
#!/usr/bin/ksh -p

OLDEXT=jad
NEWEXT=java

find ${1-"$0: no starting directory!"} -depth -type f -name *.$OLDEXT -print |
while read FILE
do
   mv $FILE ${FILE%$OLDEXT}$NEWEXT
done
#################

---------------------------------------------------------------------------------------------
foreach i (*.jad)
  mv $i `echo $i | sed 's/jad/java/' `
end

---------------------------------------------------------------------------------------------
for x in `find <Source Path> -name "*.jad"`
do
NEWFILE=`echo $x | sed 's/.jad$/.java/g'`
mv $x $NEWFILE
done

---------------------------------------------------------------------------------------------
$ for i in `ls *.jad`
do
filename=`echo $i|cut -f1 -d "."`
mv $i $filename.java
done

---------------------------------------------------------------------------------------------

for fil in `find dir_from_where_i_want_to_change -name "*.jad"`
do
base=`basename ${fil}`
mv ${fil} ${base}.java
done

---------------------------------------------------------------------------------------------
cd directory_where_you_want_to_start
for list in `find . -name "*.jad" -print`
do
   file=`basename $list .jad`
   dir= `dirname $list`
   mv $dir/$file.jad $dir/$file.java
do
---------------------------------------------------------------------------------------------

http://www.sun.com/bigadmin/scripts/index.html

follow link for regexp_rename and you will find
http://www.amc.uva.nl/cert/tools/rename.pl

---------------------------------------------------------------------------------------------

for f in `find . -name "*.jad"`; do
 mv $f `echo $f | sed 's/jad$/java/g'`
done

--------------------------------------------------------------------------------------------

for i in `find . -name "*.jad"`
do
   NAME=`basename $i`
   FILE=`echo $NAME | cut -f1 -d.`
   DIR=`dirname $i`
   mv $DIR/$FILE.jad $DIR/$FILE.java
done

>---------------------------------------------------------------------------------------------

#! /bin/ksh
cd <your directory>

ls | while read NAME
do
   NOM=`echo $NAME | awk '{FS=".";print $1}'` # Remove extension .jad
   NEW_NAME=$NOM.java
   mv $NAME $NEW_NAME
done

---------------------------------------------------------------------------------------------

#!/opt/bin/perl -s
# Usage: rename perlexpr [files]
# For example: To change all ".jad" to ".java" for ALL files in current
# directory
#
# rename 's/.jad/.java/' *
#
# NOTE: Installed by TDC on June-4-2001. Source URL was,
# http://www.sslug.dk/emailarkiv/old/1998_12/msg00856.html
>#
>
>($op = shift) || die "Usage: rename perlexpr [filenames]\n\n\;
>
>if (!@ARGV) {
> @ARGV = <STDIN>;
> chop(@ARGV);
>}
>for (@ARGV) {
> $was = $_;
> eval $op;
> die $@ if $@;
> rename($was,$_) unless $was eq $_;
>
>
>
>SolarisSys wrote:
>
>>OS - Solaris 8
>>
>>I have a large amount of files that i need to change the name of.
>>
>>I need to change all .jad file extensions and change them all to a .java extension.
>
>
>__________________________________________________________________
>McAfee VirusScan Online from the Netscape Network.
>Comprehensive protection for your entire computer. Get your free trial today!
>http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397
>
>Get AOL Instant Messenger 5.1 free of charge. Download Now!
>http://aim.aol.com/aimnew/Aim/register.adp?promo=380455
>

__________________________________________________________________
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge. Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:26:44 EDT