Sponsored Content
Full Discussion: command line args in unix
Top Forums Shell Programming and Scripting command line args in unix Post 302504265 by niteesh_!7 on Monday 14th of March 2011 07:18:26 AM
Old 03-14-2011
Error command line args in unix

Hi,

i have a perl script named test.pl. It is executed as

Code:
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

Last edited by pludi; 03-14-2011 at 09:27 AM..
 

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. Programming

Command line args

My program usage takes the form for example; $ theApp 2 "one or more words" i.e. 3 command line arguments; application name, an integer, some text My code includes the following 4 lines: int anInteger; char words; sscanf(argv, "%d", &anInteger); sscanf(argv, "%s", &message); Based... (2 Replies)
Discussion started by: enuenu
2 Replies

3. 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

4. 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

5. 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

6. 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

7. 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

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
REALMINIT(1p)						User Contributed Perl Documentation					     REALMINIT(1p)

NAME
realminit - Create new realm records for a DNSSEC-Tools realms file. SYNOPSIS
realminit [options] <realm1> ... <realmN> DESCRIPTION
realminit creates new realm entries for a realms file. dtrealms manages multiple distinct DNSSEC-Tools rollover environments running simultaneously. Each rollover environment, called a realm, is defined in a realms file. dtrealms uses this file to determine how to run the rollover environment. This is useful for such things as managing very large collections of zones, segregating customer zones, and software tests. The newly generated realm entries are written to standard output, unless the -out option is specified. A realms file contains a number of entries, one for each managed realm. A realm entry has this format: realm "example" state "active" configdir "/usr/realms/configs/example" statedir "/usr/realms/states/example" realmsdir "/usr/realms/realms-files/example" rollrec "example.rrf" administrator "bob@cat.example.com" display "1" manager "rollerd" args "-display -loglevel phase" Multiple realm entries may be created with a single execution of realminit. Except for the entry's name field, the entries will be exactly the same unless the '=' metacharacter is used in the command-line options. If the values of the configdir, statedir, realmdir, rollrec, administrator, args, or user options contain an '=', then it will be replaced with the realm's name when building the entry. See the EXAMPLES section for examples of how options are used by realminit. OPTIONS
realminit may be given the following options: -active This indicates that dtrealms should start the realm when dtrealms starts. realms are active by default. -administrator This is the email address for the realm's administrator. -args This is a set of command-line arguments passed to the realm's rollover manager when the realm is started. -configdir This is the realm's configuration directory. This will contain such files as the DNSSEC-Tools configuration file for that realm. -display This indicates if the realm should be included in grandvizier output. -inactive This indicates that dtrealms should not start the realm when dtrealms starts. -manager This is the rollover manager for the realm. rollerd is the default rollover manager, but other managers may be used. -out output-file The new realm entries will be appended to output-file. The file will be created if it does not exist. If this option is not given, the new rollrec entries will be written to standard output. -realmdir This is the realm's data directory. This directory is expected to contain the rollrec file, zone files, keyrec files, and key files for the zones in that realm. -rollrec This is the path to the realm's rollrec file. This is used to control rollover actions for the realm. If it is not an absolute path, it will be assumed to be relative to the realmdir field. -statedir This is the realm's state directory. This will contain such files as that realm's rollrec lock file and the rollerd communications socket. If the statedir is not defined for a realm, then the realm's configdir is used for that value. -user This is the user that the realm is executed as. (This is not yet implemented in dtrealms.) -help Display a usage message. -Version Display version information for realminit and DNSSEC-Tools. EXAMPLES
The following options should make clear how realminit deals with options and the new realms. Example 1 will show the complete new realm record. For the sake of brevity, the remaining examples will only show the fields relevant to that example. Further examples will also use short-hand forms of the option names. Example 1. One realm, with -statedir This example shows the realm generated by giving realminit a single realm. $ realminit -active -configdir /realms/confs/example -statedir /realms/states/example -realmdir /realms/realms/example -rollrec example.rrf -admin bob@cat.example.com -args "-loglevel phase -logfile logger" example realm "example" state "active" configdir "/realms/confs/example" statedir "/realms/states/example" realmdir "/realms/realms/example" rollrec "example.rrf" administrator "bob@cat.example.com" display "1" manager "rollerd" args "-loglevel phase -logfile logger" Example 2. One realm, without -statedir This example shows the realm generated by giving realminit a single realm. $ realminit -active -configdir /realms/confs/example -realmdir /realms/realms/example -rollrec example.rrf -admin bob@cat.example.com -args "-loglevel phase -logfile logger" example realm "example" state "active" configdir "/realms/confs/example" statedir "/realms/confs/example" ... Example 3. Two realms, without metacharacters This example shows the realms generated by giving realminit two realms, without using the special "=" metacharacter. $ realminit -configdir /realms/confs/example -statedir /realms/states/example -realmdir /realms/realms/example -rollrec example.rrf -admin bob@cat.example.com example test realm "example" configdir "/realms/confs/example" statedir "/realms/states/example" realmdir "/realms/realms/example" rollrec "example.rrf" administrator "bob@cat.example.com" ... realm "test" configdir "/realms/confs/example" statedir "/realms/states/example" realmdir "/realms/realms/example" rollrec "example.rrf" administrator "bob@cat.example.com" ... Example 4. Two realms, with metacharacters This example shows the realms generated by giving realminit two realms, and that uses the special "=" metacharacter. $ realminit -configdir /realms/confs/= -statedir /realms/states/= -realmdir /realms/realms/= -rollrec =.rrf -admin bob@cat.=.com example test realm "example" configdir "/realms/confs/example" statedir "/realms/states/example" realmdir "/realms/realms/example" rollrec "example.rrf" administrator "bob@cat.example.com" ... realm "test" configdir "/realms/confs/test" statedir "/realms/states/test" realmdir "/realms/realms/test" rollrec "test.rrf" administrator "bob@cat.test.com" ... COPYRIGHT
Copyright 2012 SPARTA, Inc. All rights reserved. See the COPYING file included with the DNSSEC-Tools package for details. AUTHOR
Wayne Morrison, tewok@tislabs.com SEE ALSO
lsrealm(1), dtrealms(8), realmchk(8) Net::DNS::SEC::Tools::realm.pm(3), file-realmrec.pm(5) perl v5.14.2 2012-06-21 REALMINIT(1p)
All times are GMT -4. The time now is 06:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy