How to take command line argument and use it to run an upgrade script.

Ask a Question related to PERL Beginners, Design and Development.

  1. #1

    Default How to take command line argument and use it to run an upgrade script.

    I'm a perl newby.
    I'm looking on taking a command line argument from
    STDIN and use it for input to a script that upgrades
    software. Any examples would be greatly appreciated.

    Thanks

    =====
    Jeffrey T. Collins
    [email]jtbaca@yahoo.com[/email]

    __________________________________
    Do you Yahoo!?
    Yahoo! SiteBuilder - Free web site building tool. Try it!
    [url]http://webhosting.yahoo.com/ps/sb/[/url]
    Jeff Collins Guest

  2. Similar Questions and Discussions

    1. My Script to run a Command-Line from ASP does not work.
      Hi, My Script to run a Command-Line from ASP does not work. No errors are returned either. It is on IIS. The directory where the script exists is...
    2. My Script to run a Command-Line from ASP does not work
      Hi, My Script to run a Command-Line from ASP does not work. No errors are returned either. It is on IIS. The directory where the script exists is...
    3. [PHP] execute command line script from browser
      Is there a way to execute a command line php script from a browser by, say clicking a button and then having the browser let go and let the script...
    4. How to use Command line argument --help or --debug ???
      using getopts we can get the arguments like -h, -s etc... but how to get --help or --debug??? Any body knowing it...plz let me know asap Thnx...
    5. using a directory name as a command line argument
      On Mon, 11 Aug 2003 19:31:26 -0700, Chad wrote: Check out @ARGV - Brian
  3. #2

    Default Re: How to take command line argument and use it to run an upgrade script.

    On Thu, 2004-01-22 at 18:14, Jeff Collins wrote:
    > I'm a perl newby.
    > I'm looking on taking a command line argument from
    > STDIN and use it for input to a script that upgrades
    > software. Any examples would be greatly appreciated.
    STDIN is already open when your perl script starts so you can read in
    from it by using:

    my $variable = <STDIN>

    And there are interfaces to curses, tk, and gtk if you feel like
    creating a nice user interface.

    Dan

    Dan Anderson Guest

  4. #3

    Default Re: How to take command line argument and use it to run an upgrade script.

    > I'm a perl newby.
    me too:-) Right list, I assume.
    > I'm looking on taking a command line argument from
    > STDIN and use it for input to a script that upgrades
    > software. Any examples would be greatly appreciated.
    @ARGV holds your command line arguments.

    call:
    scriptname.pl Universe 42 douglas 'Zappod Beblebrox'

    #! /usr/bin/perl
    use strict;
    use warnings;
    print "You called me with ", scalar @ARGV, " Arguments.\n";
    if (@ARGV) {
    print " Param to script: $_\n" foreach (@ARGV);
    }

    Notice that there is a nice wa of processing command line args with the
    getopt:: modules from CPAN.

    Also take a look at perldoc perlvar for detailed info about @ARGV, ARGV and
    $ARGV.

    Hope that helps, Wolf

    Wolf Blaum Guest

  5. #4

    Default Re: How to take command line argument and use it to run an upgrade script.


    On Jan 22, 2004, at 3:39 PM, wolf blaum wrote:
    [..]
    >
    > call:
    > scriptname.pl Universe 42 douglas 'Zappod Beblebrox'
    >
    > #! /usr/bin/perl
    > use strict;
    > use warnings;
    > print "You called me with ", scalar @ARGV, " Arguments.\n";
    > if (@ARGV) {
    > print " Param to script: $_\n" foreach (@ARGV);
    > }

    My Compliments on a well done piece.

    One of the stock modules most of us use is Getopt::Long
    which is really good for the more complex command line optioning.
    cf:
    perldoc Getopt::Long

    An Illustration:
    <[url]http://www.wetware.com/drieux/pbl/perlTrick/CommandLine/[/url]
    do_get_opt_long.txt>




    ciao
    drieux

    ---

    Drieux Guest

  6. #5

    Default Re: How to take command line argument and use it to run an upgrade script.


    > My Compliments on a well done piece.
    OT:
    see, a logical problem I have with newsgroups is that you learn most (at least
    I do) by trying to explain things you think you understood to others -
    "beginning explainers" however make mistakes -
    Thats of course not what you want in a newsgroup, since there is the one
    asking, who is learning too, whom you dont want to confuse with "slightly
    right" answers.

    Nevertheless Im happy it seems this is a group were you can even learn how to
    explain (and what the group-iquette is anyway).

    Thanks for that,
    Wolf

    Wolf Blaum Guest

  7. #6

    Default The Challenge of Learning to Explain - Re: How to take command line argument and use it to run an upgrade script.


    On Jan 22, 2004, at 5:56 PM, wolf blaum wrote:
    [..]
    > Nevertheless Im happy it seems this is a group were
    > you can even learn how to explain (and what the group-iquette is
    > anyway).
    [..]

    Good point there.

    A part of the struggle is always sort out what
    the OP is really working with, and where are they
    really trying to go with their idea. The only way
    that a person can sort that out is by trial and error.


    ciao
    drieux

    ---

    Drieux Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139