Sponsored Content
Full Discussion: Issue commands within script
Top Forums Shell Programming and Scripting Issue commands within script Post 302466206 by Chubler_XL on Tuesday 26th of October 2010 12:06:22 AM
Old 10-26-2010
Is a function what your refering to?

Code:
function myfunction
{
  # your code here
}
...

function param1 param2

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

vi Commands in a Script

Perhaps there is a better way to do this, but right now this is all I can think of. If there is a better way to do this, all suggestions are welcome. I would like to take a file and perform the following actions on it. 1. Search for CREATE TABLE 2. Copy that line and paste it one line... (7 Replies)
Discussion started by: djschmitt
7 Replies

2. UNIX for Dummies Questions & Answers

script commands

my bad (2 Replies)
Discussion started by: romeoz
2 Replies

3. Shell Programming and Scripting

Repeating commands in a script

I have written a script that I want to be repeated. The script that I wrote outputs the date, how many people are on the system, how many people logged in before me, and how many people logged in after me. Than what I want it to do is after it outputs the 4 lines I want it to go back to the... (4 Replies)
Discussion started by: Dave2874
4 Replies

4. Solaris

Canīt issue commands as root

Hello all, I am having a problem with a Solaris 8 machine. Since 3 days ago I canīt login as root. I am able to login as a normal user and su. But as soon as I issue any command the system stop responding. If I log again as a normal user I see the process still runnig. Something I noticed,... (1 Reply)
Discussion started by: kik_xxx
1 Replies

5. Shell Programming and Scripting

running commands from script

I'm new to unix and I have a fairly simple problem: Lets say I am in a specific directory and I run the command: "dirs" , I get an output of all the folders that i pushed into the stack (as expected), buut, when when I create a script (called test): #! /bin/csh dirs and then i run:... (2 Replies)
Discussion started by: owijust
2 Replies

6. Shell Programming and Scripting

Can we use aliased commands in script?

Hi All, I need a small help.. when we use aliased commands in shell script, they are not being recognized when I used. Is there any way to use aliased commands in scritping? Please let me know if u know... Thank you Chanu (19 Replies)
Discussion started by: Chanakya.m
19 Replies

7. UNIX for Dummies Questions & Answers

Using another computer to issue commands on your own

Hey guys, I'm somewhat new to Unix and the whole terminal stuff. What I need to do is run a program that runs in the terminal window (ie I type in the program name in the window and it runs) but I have to run it from my own computer as the data is on my disk. I can connect remotely to the... (1 Reply)
Discussion started by: rsingh
1 Replies

8. Shell Programming and Scripting

Issue with running commands from shell script

I'm trying to copy files from a remote windows server to Unix server. I was successfully able to copy files from windows server using command prompt but when I run these commands from a script it's not working as expected. commands used: sftp user@remoteserver.com lcd local_dir cd... (3 Replies)
Discussion started by: naresh7590
3 Replies

9. Shell Programming and Scripting

Issue with running multiple commands withing su command

RHEL 6.2/Bash shell root user will be executing the below script. It switches to oracle user and expect to do the following things A. Source the environment variables for BATGPRD Database (the file used for sourcing is shown below after the script) B. Shutdown the DB from sqlplus -- The... (13 Replies)
Discussion started by: omega3
13 Replies

10. UNIX for Beginners Questions & Answers

Expect scripting issue, works interactively when doing commands in cli, does not work in script

Hi; problem may be obvious, simple but I have to say it is somehow not easy to locate the issue. I am doing some word extracting from multiline text. Interacting in CLI seems to work without issues. First step is to add multiline text to a variable. expect1.1> expect1.1> set... (2 Replies)
Discussion started by: aldowski
2 Replies
Class::Adapter::Builder(3pm)				User Contributed Perl Documentation			      Class::Adapter::Builder(3pm)

NAME
Class::Adapter::Builder - Generate Class::Adapter classes SYNOPSIS
package My::Adapter; use strict; use Class::Adapter::Builder ISA => 'Specific::API', METHODS => [ qw{foo bar baz} ], method => 'different_method'; 1; DESCRIPTION
"Class::Adapter::Builder" is another mechanism for letting you create Adapter classes of your own. It is intended to act as a toolkit for generating the guts of many varied and different types of Adapter classes. For a simple base class you can inherit from and change a specific method, see Class::Adapter::Clear. The Pragma Interface The most common method for defining Adapter classes, as shown in the synopsis, is the pragma interface. This consists of a set of key/value pairs provided when you load the module. # The format for building Adapter classes use Class::Adapter::Builder PARAM => VALUE, ... ISA The "ISA" param is provided as either a single value, or a reference to an "ARRAY" containing is list of classes. Normally this is just a straight list of classes. However, if the value for "ISA" is set to '_OBJECT_' the object will identify itself as whatever is contained in it when the "->isa" and "->can" method are called on it. NEW Normally, you need to create your "Class::Adapter" objects separately: # Create the object my $query = CGI->new( 'param1', 'param2' ); # Create the Decorator my $object = My::Adapter->new( $query ); If you provide a class name as the "NEW" param, the Decorator will do this for you, passing on any constructor arguments. # Assume we provided the following # NEW => 'CGI', # We can now do the above in one step my $object = My::Adapter->new( 'param1', 'param2' ); AUTOLOAD By default, a "Class::Adapter" does not pass on any methods, with the methods to be passed on specified explicitly with the 'METHODS' param. By setting "AUTOLOAD" to true, the "Adapter" will be given the standard "AUTOLOAD" function to to pass through all unspecified methods to the parent object. By default the AUTOLOAD will pass through any and all calls, including calls to private methods. If the AUTOLOAD is specifically set to 'PUBLIC', the AUTOLOAD setting will ONLY apply to public methods, and any private methods will not be passed through. METHODS The "METHODS" param is provided as a reference to an array of all the methods that are to be passed through to the parent object as is. Any params other than the ones specified above are taken as translated methods. # If you provide the following # foo => bar # It the following are equivalent $decorator->foo; $decorator->_OBJECT_->bar; This capability is provided primarily because in Perl one of the main situations in which you hit the limits of Perl's inheritance model is when your class needs to inherit from multiple different classes that containing clashing methods. For example: # If your class is like this package Foo; use base 'This', 'That'; 1; If both "This->method" exists and "That->method" exists, and both mean different things, then "Foo->method" becomes ambiguous. A "Class::Adapter" could be used to wrap your "Foo" object, with the "Class::Adapter" becoming the "That" sub-class, and passing "$decorator->method" through to "$object->that_method". METHODS
Yes, "Class::Adapter::Builder" has public methods and later on you will be able to access them directly, but for now they are remaining undocumented, so that I can shuffle things around for another few versions. Just stick to the pragma interface for now. SUPPORT
Bugs should be reported via the CPAN bug tracker at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Class-Adapter> For other issues, contact the author. AUTHOR
Adam Kennedy <adamk@cpan.org> SEE ALSO
Class::Adapter, Class::Adapter::Clear COPYRIGHT
Copyright 2005 - 2010 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.10.1 2010-04-12 Class::Adapter::Builder(3pm)
All times are GMT -4. The time now is 09:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy