From 29240900238e6767cbad8298ddda413e03aec693 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Mon, 9 Aug 2004 23:45:01 +0000 Subject: [PATCH] new shell script used for test programs. --- bin/exp3to2.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 bin/exp3to2.sh diff --git a/bin/exp3to2.sh b/bin/exp3to2.sh new file mode 100755 index 000000000..61866b41f --- /dev/null +++ b/bin/exp3to2.sh @@ -0,0 +1,20 @@ +#/bin/sh +# +# This sed script replaces 3 character exponents +# starting with 0 with 2 characters +# e-0xx -> e-xx +# e0xx -> exx +# E-0xx -> E-xx +# E0xx -> Exx +# where +# x is a digit +# +# It takes one argument, the file to be operated on. +# And, it writes to standard out. It may be used to do a +# replacement in place. +# +cp $1 .exp.txt +cat .exp.txt | sed 's/\([eE]-\)\(0\)\([0-9][0-9]\)/\1\3/g' | \ + sed 's/\([eE]\)\(0\)\([0-9][0-9]\)/\1\3/g' | \ + sed 's/\([eE]+\)\(0\)\([0-9][0-9]\)/\1\3/g' +rm .exp.txt