You could source the script with the function in it, perhaps that is what you need.
Does that do the sort of thing you need? You may also see the shortcut of . instead of source but it;'s a little less clear and more difficult to search for. You would end up with a line like . ./my_function_script.sh
Either way, the script being sourced is executed in the current shell so the declared functions remain available. You have to be careful that you really want to run it, so most people have a block on functions only in what they source in.
I hope that this helps,
Robin
Last edited by rbatte1; 07-23-2019 at 07:30 AM..
Reason: Managed to double-up CODE tags
Keeping in mind that I'm relatively comfortable with programming in general but very new to unix and korn/bourne shell scripts..
I'm using awk on a CSV file, and then performing calculations and operations on specific fields within specific records. The CSV file I'm working with has about 600... (2 Replies)
Is it possible to make function variables local?
I mean for example, I have a script variable 'name' and in function I have declared variable 'name'
I need to have script's 'name' have the same value as it was before calling the function with the same declaration.
The way to preserve a... (5 Replies)
Hi,
I have a base class and derived a class from the base class, i want to print & read the data for the object created for the derived class,so i have overloaded both the << and >> operators and also have done the foward declaration.
Below is the code snippet,
#include <iostream>
class... (3 Replies)
I use a simple script to do some quantum calculations with gaussian package. the script as follows
#!/bin/sh
#put a gaussian input file into a new folder in the same name
#and submit this new job
for i in *.gjf
do
FN=$( echo $i | sed 's/.gjf//')
mkdir $FN
mv... (1 Reply)
I wrote the following Makefile:
dirs := a b c d
files := $(foreach dir,$(dirs),$(wildcard $(dir)/*))
.PHONY: all
all:
touch $(files)
The first two lines are taken from GNU make tutorial, Section 8.5 The foreach Function. I would expect the recipe
touch $(files)
to be... (2 Replies)
Greetings,
I m wondering if it's possible do do the following :
I have a simple function called "FindMoveDelete" which does the following :
FindMoveDelete()
{
find . -iname "$FILENAME*.ext" -exec mv {} "$PATH/$VAR" \; &&
find . -maxdepth 1 -type d -iname "$FILENAME*" -exec rm -rf {}... (6 Replies)
Hello,
I was trying to understand more on strtok_r() function with following code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* *From http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=strtok_r
A FreeBSD man pages * */
int main()
{
char string1;
char *sep =... (8 Replies)
Hi,
If I declare a function inside another function, it overwrites any previously declared function with the same name. This is NOT what I want.
Example:
#!/bin/bash
_test() { echo test; }
_myf() {
# I'm using the same name as the other function.
_test() { echo local test; }... (8 Replies)
Hi All,
Good Day, seeking for your assistance on how to not perform my 2nd, 3rd,4th etc.. function if my 1st function is in else condition.
#Body
function1()
{
if
then
echo "exist"
else
echo "not exist"
}
#if not exist in function1 my all other function will not proceed.... (4 Replies)
Discussion started by: meister29
4 Replies
LEARN ABOUT DEBIAN
net::epp::frame::greeting
Net::EPP::Frame::Greeting(3pm) User Contributed Perl Documentation Net::EPP::Frame::Greeting(3pm)NAME
Net::EPP::Frame::Greeting - an instance of Net::EPP::Frame for server greetings
DESCRIPTION
This module is a subclass of Net::EPP::Frame that represents EPP server greetings.
According to the EPP RFC, the server must transmit an EPP greeting frame to the client upon connection, and in response to an EPP "<hello>"
command. The "<greeting>" frame provides information about the server, including the server time, access control rules, and a list of the
object types that are provisioned by the server.
OBJECT HIERARCHY
L<XML::LibXML::Node>
+----L<XML::LibXML::Document>
+----L<Net::EPP::Frame>
+----L<Net::EPP::Frame::Greeting>
METHODS
my $node = $frame->greeting;
This method returns the XML::LibXML::Element object corresponding to the "<greeting>" element.
my $node = $frame->svID;
This method returns the XML::LibXML::Element object corresponding to the "<svID>" element.
my $node = $frame->svDate;
This method returns the XML::LibXML::Element object corresponding to the "<svDate>" element.
my $node = $frame->svcMenu;
This method returns the XML::LibXML::Element object corresponding to the "<svcMenu>" element.
my $node = $frame->dcp;
This method returns the XML::LibXML::Element object corresponding to the "<dcp>" element.
AUTHOR
CentralNic Ltd (http://www.centralnic.com/).
COPYRIGHT
This module is (c) 2012 CentralNic Ltd. This module is free software; you can redistribute it and/or modify it under the same terms as Perl
itself.
SEE ALSO
o Net::EPP::Frame
perl v5.14.2 2012-04-23 Net::EPP::Frame::Greeting(3pm)