Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
alberta3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ians-nmh-siebert
alberta
alberta3
Commits
e433e533
Commit
e433e533
authored
21 years ago
by
Claus-Justus Heine
Browse files
Options
Downloads
Patches
Plain Diff
Initial revision.
parent
5a7b8186
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
changesex.sh
+67
-0
67 additions, 0 deletions
changesex.sh
with
67 additions
and
0 deletions
changesex.sh
0 → 100755
+
67
−
0
View file @
e433e533
#! /bin/sh
#
# Don't use a for loop, the number of files might exceed the
# command-line limit.
#
# This script changes albert to alberta and ALBERT to ALBERTA
# in _any_ regular file.
#
#
ECHO
=
while
test
$#
-gt
0
;
do
case
$1
in
DRYRUN
)
set
-x
ECHO
=
echo
ESC
=
\\
;;
REVERSE
)
REVERSE
=
1
;;
LIST
)
LIST
=
1
;;
*
)
echo
"The arguments must be DRYRUN, REVERSE or LIST"
exit
1
;;
esac
shift
done
trap
"rm -f /tmp/changesex.
$$
"
0
if
test
-z
"
$REVERSE
"
;
then
cat
>
/tmp/changesex.
$$
<<
EOF
#! /bin/sh
F=
\$
1
if ! echo
\$
F|grep -iqs "/CVS/" &&
\\
! grep -iqs alberta
\$
F && grep -iqs albert
\$
F ; then
echo "ALBERT -> ALBERTA in
\$
F"
if test -z "
$LIST
"; then
$ECHO
sed -e 's/albert/alberta/g' -e 's/ALBERT/ALBERTA/g'
\$
F
$ESC
>
\$
F.new
$ECHO
mv -f
\$
F.new
\$
F
fi
fi
EOF
else
cat
>
/tmp/changesex.
$$
<<
EOF
#! /bin/sh
F=
\$
1
if ! echo
\$
F|grep -iqs "/CVS/" && grep -iqs alberta
\$
F ; then
echo "ALBERTA -> ALBERT in
\$
F"
if test -z "
$LIST
"; then
$ECHO
sed -e 's/alberta/albert/g' -e 's/ALBERTA/ALBERT/g'
\$
F
$ESC
>
\$
F.new
$ECHO
mv -f
\$
F.new
\$
F
fi
fi
EOF
fi
chmod
+x /tmp/changesex.
$$
find
.
\(
-type
f
-a
\!
\(
-name
"*.new"
-o
-name
".*.new"
\)
\)
-exec
/tmp/changesex.
$$
\{\}
\;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment