diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-09 00:49:07 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-09 00:49:07 +0000 |
commit | 007f67a693e4d031fd3d792df8e4d5f43e2cb2e7 (patch) | |
tree | 90d17e00e572ecb1e24764b6f29c80e098b08d29 /Master/texmf-dist/doc/latex/expressg/n2mpsprl.prl | |
parent | 950209b26f70aa87ed07c54f82a95b6f03b7c3a0 (diff) |
doc/latex
git-svn-id: svn://tug.org/texlive/trunk@84 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/expressg/n2mpsprl.prl')
-rw-r--r-- | Master/texmf-dist/doc/latex/expressg/n2mpsprl.prl | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/expressg/n2mpsprl.prl b/Master/texmf-dist/doc/latex/expressg/n2mpsprl.prl new file mode 100644 index 00000000000..6dffe5c4a63 --- /dev/null +++ b/Master/texmf-dist/doc/latex/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 ########################## + |