Sponsored Content
Full Discussion: Command line args
Top Forums Programming Command line args Post 302119219 by enuenu on Tuesday 29th of May 2007 12:19:00 AM
Old 05-29-2007
Thanks very much, problem solved.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

required command line args

Hello, How do I make a command line argument required using getopts? Thanks. (6 Replies)
Discussion started by: yoi2hot4ya
6 Replies

2. UNIX for Dummies Questions & Answers

command line args

I am trying to print command line arguments one per second. I have this while do echo "6" shift echo "5" shift echo "4" shift echo "3" shift echo "2" shift echo "1" shift done (2 Replies)
Discussion started by: skooly5
2 Replies

3. UNIX for Dummies Questions & Answers

command line args 2

I have this while loop and at the end I am trying to get it to tell me the last argument I entered. And with it like this all I get is the sentence with no value for $1. Now I tried moving done after the sentence and it printed the value of $1 after every number. I don't want that I just want... (2 Replies)
Discussion started by: skooly5
2 Replies

4. Shell Programming and Scripting

How to retrieve command line args one by on.

Hi, I have to store all the command line arguments into an array. I have the following code. ********************** #! /bin/sh set -A arr_no_updates i=1 while do arr_no_updates=$($i) echo ${arr_no_updates} i=$(($i+1)) done**************** (1 Reply)
Discussion started by: little_wonder
1 Replies

5. Shell Programming and Scripting

How to send a function all command line args?

I have this code, I thought it would automatically know the args sent to script when called from shell. But it seems to not see any... main script: . args . errors . opt . clean dbfile="" opfile="" # calls function in script below chkarg #check commands (2 Replies)
Discussion started by: gcampton
2 Replies

6. Shell Programming and Scripting

problem with KSH script: command line args

Hi I am executing a KSH script by passing command line arguments example: Red Green Dark Red Blue when I am splitting the arguments by using " "(Space) as delimiter But the colour Dark Red is a single parameter. But it is getting splitted in between How to avoid this. Please help Also... (4 Replies)
Discussion started by: hemanth424
4 Replies

7. Shell Programming and Scripting

command line args in unix

Hi, i have a perl script named test.pl. It is executed as cat *.log|test.pl i need the complete command line args. I tried using basename $0 but im getting test.pl only but not cat *.log... Can anyone help me on this. Thanks in advance (3 Replies)
Discussion started by: niteesh_!7
3 Replies

8. Emergency UNIX and Linux Support

Cut | command line args

Hi, Can you please hint me how to achieve the below? Input: $./script.sh start 1 2 Internally inside the script i want to set a single variable with $2 and $3 value? Output: CMD=$1 ARGS=$2 $3 --VInodh (10 Replies)
Discussion started by: vino_hymi
10 Replies

9. Shell Programming and Scripting

Passing Command Line Args in a Single Variable?

Hello All, I have a Bash Script and an Expect script that together will SSH to another server and do some stuff there... From within the Bash Script I process the Command Line Arguments, which are Required Args and Optional Args. When I call the Expect script from the Bash Script, I pass... (4 Replies)
Discussion started by: mrm5102
4 Replies

10. Shell Programming and Scripting

Getopts how to handle missing '-' in command line args.

I'm using getopts to process command line args in a Bash script. The code looks like this: while getopts ":cfmvhs:t:" option; do case $option in c) operationMode="CHECK" ;; f) operationMode="FAST" ;; m) ... (6 Replies)
Discussion started by: gencon
6 Replies
SVK::Command(3) 					User Contributed Perl Documentation					   SVK::Command(3)

NAME
SVK::Command - Base class and dispatcher for SVK commands SYNOPSIS
use SVK::Command; my $xd = SVK::XD->new ( ... ); my $cmd = 'checkout'; my @args = qw( file1 file2 ); open my $output_fh, '>', 'svk.log' or die $!; SVK::Command->invoke ($xd, $cmd, $output_fh, @args); DESCRIPTION
This module resolves alias for commands and dispatches them, usually with the "invoke" method. If the command invocation is incorrect, usage information is displayed instead. METHODS
Class Methods invoke ($xd, $cmd, $output_fh, @args) Takes a SVK::XD object, the command name, the output scalar reference, and the arguments for the command. The command name is translated with the %alias map. On Win32, after @args is parsed for named options, the remaining positional arguments are expanded for shell globbing with "bsd_glob". getopt ($argv, %opt) Takes a arrayref of argv for run getopt for the command, with additional %opt getopt options. Instance Methods "SVK::Command->invoke" loads the corresponding class "SVK::Command::$name", so that's the class you want to implement the following methods in: options () Returns a hash where the keys are Getopt::Long specs and the values are a string that will be the keys storing the parsed option in $self. Subclasses should override this to add their own options. Defaults to an empty list. opt_recursive Defines if the command needs the recursive flag and its default. The value will be stored in "recursive". parse_arg (@args) This method is called with the remaining arguments after parsing named options with "options" above. It should use the "arg_*" methods to return a list of parsed arguments for the command's "lock" and "run" method to process. Defaults to return a single "undef". lock (@parse_args) Calls the "lock_*" methods to lock the SVK::XD object. The arguments will be what is returned from "parse_arg". run (@parsed_args) Actually process the command. The arguments will be what is returned from "parse_arg". Returned undef on success. Return a string message to notify the caller errors. Utility Methods Except for "arg_depotname", all "arg_*" methods below returns a SVK::Path object, which consists of a hash with the following keys: cinfo copath depotpath path repos repospath report targets The hashes are handy to pass to many other functions. arg_condensed (@args) Argument is a number of checkout paths. arg_uri_maybe ($arg, $no_new_mirror) Argument might be a URI or a depotpath. If it is a URI, try to find it at or under one of currently mirrored paths. If not found, prompts the user to mirror and sync it. arg_co_maybe ($arg, $no_new_mirror) Argument might be a checkout path or a depotpath. If argument is URI then handles it via "arg_uri_maybe". arg_copath ($arg) Argument is a checkout path. arg_depotpath ($arg) Argument is a depotpath, including the slashes and depot name. arg_depotroot ($arg) Argument is a depot root, or a checkout path that needs to be resolved into a depot root. arg_depotname ($arg) Argument is a name of depot. such as '' or 'test' that is being used normally between two slashes. arg_path ($arg) Argument is a plain path in the filesystem. apply_revision($target) Apply the given revision from command line to $target. parse_revlist () Parse -c or -r to a list of [from, to] pairs. lock_target ($target) XXX Undocumented lock_coroot ($target) XXX Undocumented brief_usage ($file) Display an one-line brief usage of the command object. Optionally, a file could be given to extract the usage from the POD. filename Return the filename for the command module. usage ($want_detail) Display usage. If $want_detail is true, the "DESCRIPTION" section is displayed as well. Error Handling handle_error ($error) XXX Undocumented add_handler ($error, $handler) XXX Undocumented msg_handler ($error, $message) XXX Undocumented msg_handler ($error) XXX Undocumented command ($cmd, \%args) Construct a command object of the $cmd subclass and return it. The new object will share the "xd" from the calling command object; contents in %args is also assigned into the new object. rebless ($cmd, \%args) Like "command" above, but modifies the calling object instead of creating a new one. Useful for a command object to recast itself into another command class. run_command_recursively($target, $code) Traverse $target and and invoke $code with each node. SEE ALSO
SVK, SVK::XD, "SVK::Command::*" perl v5.10.0 2008-08-04 SVK::Command(3)
All times are GMT -4. The time now is 10:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy