inputing parameters on command line *HELP* needed 
Author Message
 inputing parameters on command line *HELP* needed

I have been having problems trying to write a little script to do a
simple task.  I first tried using a shell script, but could not
get the syntax right (using TCSH.)  I want to, with one command, print
out selected pages of a tex file.

The parameters needed are: 1) name of tex file, 2) page beginning, and
3) page ending.

For example If the tex file is called foo.tex the sequence of commands
needed is something like this.

latex foo.tex
dvips foo.dvi -o foo.ps
psselect -pa-b foo.ps foo.a-b.ps  #-pa-b= pages from a to b
lpr foo.a-b.ps

-------
I can't figure out what I am doing wrong - it has to be something
simple I am overlooking.

Thanks for the help!
Luke
(using perl 5)
--



Tue, 17 Nov 1998 03:00:00 GMT  
 inputing parameters on command line *HELP* needed

Quote:

> I have been having problems trying to write a little script to do a
> simple task.  I first tried using a shell script, but could not
> get the syntax right (using TCSH.)

TCSH?
*= Barf =*

11th Commandment:
        Thou shalt not write shell scripts in ye cursed [t]csh!

Quote:
> I want to, with one command, print out selected pages of a tex file.

--- snip ---
#!/usr/local/bin/perl

$base = $file; $base =~ s/\.tex$//;

system("latex $file");
system("dvips $base.dvi -o $base.ps");
system("psselect -p$first-$last $base.ps $base.$first-$last.ps");
system("lpr $base.$first-$last.ps");
__END__

--- snip ---
#!/bin/sh
file=$1; first=$2; last=$3
base=`basename $file .tex`
{*filter*}$file
dvips $base.dvi -o $base.ps
psselect -p$first-$last $base.ps $base.$first-$last.ps
lpr $base.$first-$last.ps
exit 0
#--- snip ---

Quote:
> I can't figure out what I am doing wrong - it has to be something
> simple I am overlooking.

Like the manual pages? ;-)

                        Cheers,
                        Steven



Tue, 01 Dec 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Newbie needs help- trying to submit command-line function to perl script via web

2. Interactive program with command line history/vi mode--help needed

3. Need help with command line for CGI for NT

4. Need help with command line arguments

5. Need help implementing command line switch

6. Command line parameters to Perl scripts

7. How to hide command line parameters from modules?

8. how to grab a parameter from command line and do a search and replace in script

9. Passing Command Line Parameters cgi file

10. Command line parameters under mod_perl

11. Command line parameters / Wildcard characters / Recursive directories

12. passing parameters from command line?

 

 
Powered by phpBB® Forum Software