diff options
author | Karl Berry <karl@freefriends.org> | 2007-08-20 18:04:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-08-20 18:04:48 +0000 |
commit | 33bb92baf2f4e3415dc95f87eeb939e09530b501 (patch) | |
tree | cf91343b9ec33e7cec79b29a8e0fc3c0d089ca40 /Master/texmf-dist/doc/metapost/expressg/n2mpsprl.prl | |
parent | a5b418efaeb33e9ffe036ba3b54fa12397ac7705 (diff) |
expressg is metapost (luecking 23 Jul 2007 13:47:15)
git-svn-id: svn://tug.org/texlive/trunk@4777 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/metapost/expressg/n2mpsprl.prl')
-rw-r--r-- | Master/texmf-dist/doc/metapost/expressg/n2mpsprl.prl | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/metapost/expressg/n2mpsprl.prl b/Master/texmf-dist/doc/metapost/expressg/n2mpsprl.prl new file mode 100644 index 00000000000..6dffe5c4a63 --- /dev/null +++ b/Master/texmf-dist/doc/metapost/expressg/n2mpsprl.prl @@ -0,0 +1,43 @@ + +#!/usr/local/bin/perl -w + +################################################################### +# Perl script: n2mpsprl.prl +# Call as: n2mpsprl.prl filename +# If filename is of the form basename.N, where N is an integer, +# copies file basename.N to file basenameN.mps +# +# Copyright 2000, Mauro S. Costa and Peter R. Wilson +################################################################## + +# Test for correct number of input parameters +die "Invalid command line arguments.\nTry $0 <src> \n" if($#ARGV > 1); +die "Invalid command line arguments.\nTry $0 <src> \n" if($#ARGV < 0); + +# Assign input file name to variable +$input_file = $ARGV[0]; + +## test if ends with a number, exit if not +if ($input_file =~ /\w\.\d/) { ; } else { exit; } + +# Remove the "dot" from the string variable +# holding the input file name +$input_file =~ s/\.// ; + +# Create a list variable composed of the string variable holding +# the concatenated input file name and the extension ".mps" +@name_list = ($input_file,'.mps') ; + +# Join the string variables in the name_list variable into +# a single string variable +$output_file = join("",@name_list) ; + +# create a list variable composed to the parameters needed +# for the system copy command excution +@exec_list = ('cp', $ARGV[0], $output_file) ; + +# Execute the system copy ("cp") command +system(@exec_list) ; + +############################ end perl script ########################## + |