Differences From Artifact [f90f4679c7]:

To Artifact [3a5380cfd9]:


10
11
12
13
14
15
16



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46


# Copyright (c) P.J.Gawthrop 1998

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## Revision 1.4  1998/08/15 13:50:22  peterg
## Doesn't zap preexisting files
##
## Revision 1.3  1998/08/14 15:37:38  peterg
## rename now copies - no delete
##
## Revision 1.2  1998/01/06 13:57:39  peterg
## Now removes old version after copying
##
# Revision 1.1  1998/01/06  13:48:23  peterg
# Initial revision
#
###############################################################

old_name=$1
new_name=$2
extension=$3

left='[^a-zA-z]'
right=$left
if [ -f "$new_name$extension" ]; then
   echo  "$new_name$extension \t already exists -- no action taken"
   exit
fi
if ls $old_name$extension > /dev/null 2>&1 
    then
	echo Renaming $old_name$extension to $new_name$extension
	sed "s/\($left\)$old_name\($right\)/\1$new_name\2/g" <$old_name$extension >$new_name$extension
fi










>
>
>


















|


|








>
>
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Copyright (c) P.J.Gawthrop 1998

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.5  2000/12/27 13:11:42  peterg
## *** empty log message ***
##
## Revision 1.4  1998/08/15 13:50:22  peterg
## Doesn't zap preexisting files
##
## Revision 1.3  1998/08/14 15:37:38  peterg
## rename now copies - no delete
##
## Revision 1.2  1998/01/06 13:57:39  peterg
## Now removes old version after copying
##
# Revision 1.1  1998/01/06  13:48:23  peterg
# Initial revision
#
###############################################################

old_name=$1
new_name=$2
extension=$3

left='[^a-zA-Z]*'
right=$left
if [ -f "$new_name$extension" ]; then
   echo  "$new_name$extension already exists -- no action taken"
   exit
fi
if ls $old_name$extension > /dev/null 2>&1 
    then
	echo Renaming $old_name$extension to $new_name$extension
	sed "s/\($left\)$old_name\($right\)/\1$new_name\2/g" <$old_name$extension >$new_name$extension
fi




MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]