Sponsored Content
Full Discussion: Positional Parameters
Top Forums UNIX for Dummies Questions & Answers Positional Parameters Post 302347074 by Leppie on Monday 24th of August 2009 09:00:21 PM
Old 08-24-2009
positional parameters are command line options and arguments:
Code:
find searchdir searchfile -myoption

$0 = find
$1 = searchdir
$2 = searchfile
$3 = -myoption
etc.

hope this helps

Last edited by Leppie; 08-24-2009 at 10:29 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Positional Parameters

HPUX11.0/Korn Shell I have an old script that takes in a series of arguments when its called. The script is really more of a common set of functions that gets called by other scripts as needed. I have been asked to make this into a menu driven script to rollout to app support for their use during... (2 Replies)
Discussion started by: google
2 Replies

2. UNIX for Dummies Questions & Answers

Positional Parameters

Hello, I am using the Bourne shell. I am trying to understand the concept of positional parameters. I do understand that positional parameters: 1. Are initialized by shell 2. Have a max of 9 parameters ($1 to $9) 3. Have no limit on the number of arguments 4. Can be rearranged... (15 Replies)
Discussion started by: ericelysia
15 Replies

3. UNIX for Dummies Questions & Answers

Positional parameters

I need to get file names from commandline arguments, it may be any no of arguements, Using for loop i got but how do i display it, bcoz $i will give the number i is assigned $$i is not working either $($i), i need the names of the files got in the arguement (2 Replies)
Discussion started by: shalu@ibm
2 Replies

4. Shell Programming and Scripting

Resetting the Positional parameters values

Hi, Can any one provide the Unix command to reset the positional parameters? Please see the below example where i have to pass 2 parameters to Shell1.sh. Step1) . ./Shell1.sh 2 3 successfully executed, Then i executed(next step only) the same shell script again,this time no... (4 Replies)
Discussion started by: nmk
4 Replies

5. Shell Programming and Scripting

checking the positional parameters

Hi all, I have one small requirment... I have prepared one script. we have to pass two possitional parameters to the script. What I want to do is if the parameters are not passed then i dont want the script to start the process... For ex: $ ./a.sh parm1 parm2 #Here, it can start... (7 Replies)
Discussion started by: raghu.iv85
7 Replies

6. Shell Programming and Scripting

Bash Positional Parameters Question

In a Bash script I used getopts command to let a user does something regards to the selected options. The question is: How do you find out what is the name of the file that user inserted in the command line like the following: The good part is this file is always the last argument in the... (2 Replies)
Discussion started by: bashily
2 Replies

7. Homework & Coursework Questions

Positional Parameters Shell Scripting

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: STEP 1: Create a Bash shell script (myscript) inside the a2 directory. The script should allow the user to pass... (3 Replies)
Discussion started by: tazb
3 Replies

8. Shell Programming and Scripting

Use positional parameters in loop / while syntax in whiptail

I like to “optimize” / make more like a real program my bash script by replacing repetitious code which utilizes positional parameters. I am having two issues I cannot solve and would appreciate some assistance with resolving them. a) how to modify the whiptail checklist... (3 Replies)
Discussion started by: annacreek
3 Replies

9. UNIX for Beginners Questions & Answers

'sed' with Positional Parameters

I'm new with 'sed' and for sure something still I don't understand yet with it. If you see my output on ">Output..." portion, the new directory still on "source_dir" instead of "dest_dir". You may disregard for the "tar" part, this is just a test script, just for me to understand 'sed' using the... (3 Replies)
Discussion started by: daryl0505
3 Replies

10. UNIX for Beginners Questions & Answers

Positional parameters in if statement

I am trying to code an if statement that accepts two parameters and see if those parameters are in another file called teledir.txt. If it already exists in the file, it is to say "Entry Exists". If not, I add it to the file and say "Entry Added". This is the code I have so far: if ; then ... (1 Reply)
Discussion started by: Eric7giants
1 Replies
Mail::SPF::Mod(3)					User Contributed Perl Documentation					 Mail::SPF::Mod(3)

NAME
Mail::SPF::Mod - SPF record modifier base class DESCRIPTION
An object of class Mail::SPF::Mod represents a modifier within an SPF record. Mail::SPF::Mod cannot be instantiated directly. Create an instance of a concrete sub-class instead. Constructors The following constructors are provided: new(%options): returns Mail::SPF::Mod Abstract. Creates a new SPF record modifier object. %options is a list of key/value pairs representing any of the following options: text A string denoting the unparsed text of the modifier. name A string denoting the name of the modifier. Required if a generic Mail::SPF::Mod object (as opposed to a specific sub-class) is being constructed. domain_spec Either a plain string or a Mail::SPF::MacroString object denoting an optional "domain-spec" parameter of the mechanism. new_from_string($text, %options): returns Mail::SPF::Mod; throws Mail::SPF::ENothingToParse, Mail::SPF::EInvalidMod Abstract. Creates a new SPF record modifier object by parsing the string and any options given. Class methods The following class methods are provided: name_pattern: returns Regexp Returns a regular expression that matches any legal modifier name. Instance methods The following instance methods are provided: text: returns string; throws Mail::SPF::ENoUnparsedText Returns the unparsed text of the modifier. Throws a Mail::SPF::ENoUnparsedText exception if the modifier was created synthetically instead of being parsed, and no text was provided. name: returns string Returns the name of the modifier. params: returns string Abstract. Returns the modifier's parameters formatted as a string. A sub-class of Mail::SPF::Mod does not have to implement this method if it supports no parameters, although this is highly unlikely. stringify: returns string Formats the modifier's name and parameters as a string and returns it. You can simply use a Mail::SPF::Mod object as a string for the same effect, see "OVERLOADING". process: throws Mail::SPF::Result, Mail::SPF::Result::Error, Mail::SPF::Exception Abstract. Processes the modifier. What that means depends on the actual implementation in sub-classes. See "MODIFIER TYPES" below. This method is abstract and must be implemented by sub-classes of Mail::SPF::Mod. MODIFIER TYPES
There are different basic types of modifiers, which are described below. All of them are provided by the Mail::SPF::Mod module. Global modifiers - Mail::SPF::GlobalMod SPFv1 (RFC 4408) only knows "global" modifiers. A global modifier may appear anywhere in an SPF record, but only once. During evaluation of the record, global modifiers are processed after the last mechanism has been evaluated and an SPF result has been determined. The following additional class method is provided by Mail::SPF::GlobalMod: precedence: returns real Abstract. Returns a real number between 0 and 1 denoting the precedence of the type of the global modifier. Global modifiers present in an SPF record are processed in the order of their precedence values, 0 meaning "first". This method is abstract and must be implemented by sub-classes of Mail::SPF::GlobalMod. The following specific instance method is provided by Mail::SPF::GlobalMod: process($server, $request, $result): throws Mail::SPF::Result Abstract. Processes the modifier. What that means depends on the actual implementation in sub-classes. Takes both a Mail::SPF::Server and a Mail::SPF::Request object. As global modifiers are generally processed after an SPF result has already been determined, takes also the current Mail::SPF::Result. If the modifier wishes to modify the SPF result, it may throw a different Mail::SPF::Result object. This method is abstract and must be implemented by sub-classes of Mail::SPF::GlobalMod. Positional modifiers - Mail::SPF::PositionalMod Sender ID (RFC 4406) introduces the concept of "positional" modifiers. According to RFC 4406, a positional modifier must follow a mechanism and applies to that, and only that, mechanism. However, because this definition is not very useful, and because no positional modifiers have been defined based on it as of yet, Mail::SPF deviates from RFC 4406 as follows: A positional modifier may appear anywhere in an SPF record, and it is stateful, i.e. it applies to all mechanisms and modifiers that follow it. Positional modifiers are generally multiple, i.e. they may appear any number of times throughout the record. During evaluation of the record, positional modifiers are processed at exactly the time when they are encountered by the evaluator. Consequently, all positional modifiers are processed before an SPF result is determined. The following specific instance method is provided by Mail::SPF::PositionalMod: process($server, $request): throws Mail::SPF::Result::Error, Mail::SPF::Exception Abstract. Processes the modifier. What that means depends on the actual implementation in sub-classes. Takes both a Mail::SPF::Server and a Mail::SPF::Request object. As global modifiers are generally processed before an SPF result has been determined, no result object is available to the modifier. The modifier can (at least at this time) not directly modify the final SPF result, however it may throw an exception to signal an error condition. This method is abstract and must be implemented by sub-classes of Mail::SPF::PositionalMod. Unknown modifiers - Mail::SPF::UnknownMod Both SPFv1 and Sender ID allow unknown modifiers to appear in SPF records in order to allow new modifiers to be introduced without breaking existing implementations. Obviously, unknown modifiers are neither global nor positional, but they may appear any number of times throughout the record and are simply ignored during evaluation of the record. Also obviously, Mail::SPF::UnknownMod does not support a "process" method. The following specific instance method is provided by Mail::SPF::UnknownMod: params: returns string Returns the modifier's unparsed value as a string. OVERLOADING
If a Mail::SPF::Mod object is used as a string, the "stringify" method is used to convert the object into a string. SEE ALSO
Mail::SPF::Mod::Redirect, Mail::SPF::Mod::Exp Mail::SPF, Mail::SPF::Record, Mail::SPF::Term <http://tools.ietf.org/html/rfc4408> For availability, support, and license information, see the README file included with Mail::SPF. AUTHORS
Julian Mehnle <julian@mehnle.net>, Shevek <cpan@anarres.org> perl v5.16.3 2014-06-10 Mail::SPF::Mod(3)
All times are GMT -4. The time now is 11:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy