[HPADM] RE: Re: Scripting question - functions

From: Jeff Lightner (jlightner@water.com)
Date: Thu Apr 06 2006 - 10:00:42 EDT


Sam,

1) You're not supposed to reply all in this forum. (Yes I know I have
in this reply but felt it appropriate for the next point.)

2) Why ask Bryan about posting here? The question is certainly
relevant to HP-UX. The fact that it is also relevant to any other
flavor of Unix/Linux using ksh or Posix sh doesn't make it inappropriate
here.

This list is not restricted to HP proprietary applications. It is a
list for HP-UX Admins to ask questions that help them with HP-UX
administration. Since HP-UX is a Unix variant there are bound to be
thousands of questions that relate to HP-UX and yet also to Unix/Linux
administration in general.

-----Original Message-----
From: hpux-admin-owner@DutchWorks.nl
[mailto:hpux-admin-owner@DutchWorks.nl] On Behalf Of Samuel G. Cristobal
Sent: Thursday, April 06, 2006 9:33 AM
To: hpux-admin@dutchworks.nl
Subject: [HPADM] Re: Scripting question - functions

Bryan,
I think is what you need:

---------
funtion_a (){
value=$1
var=value
echo $var
}

funtion_b(){
$val_a=$(funtion_a 1)
echo $val
}
------------

But, why do you ask this in a HP UX Admin list ?

Regards

---
Samuel G. Cristobal <samuel.guinales@hp.com>
Hewlett Packard TSG
C/ Vicente Aleixandre, 1
28230 - Madrid  (Spain)
Telf. Movil: 685483866
On Wed, April 5, 2006 3:01 pm, Quinn, Bryan wrote:
> How can I return a variable and it's assigned value from a function? I
> would like to have function A assign a value to a variable and then
return
> that variable back to the script to be used in function B.
>
> Thanks,
>
> Bryan Douglas Quinn
> UNIX Support Specialist
> HP Certified IT Professional
> Cooper Tools - Lexington, SC
> 803.808.6770
> bryan.quinn@coopertools.com
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.385 / Virus Database: 268.3.5/300 - Release Date:
4/3/2006
>
> The preceding e-mail message (including any attachments) contains
> information that may be confidential, or constitute non-public
> information.
> It is intended only for the designated recipient.  If you are not the
> named addressee, you should not disseminate, distribute or copy this
> e-mail.
> If you have received this e-mail by mistake,  please notify the sender
> immediately by replying to this message and delete this e-mail from
your
> system.
> Use, dissemination, distribution or reproduction of this message by
> unintended recipients is not authorized and may be unlawful.
>
> --
>              ---> Please post QUESTIONS and SUMMARIES only!! <---
>         To subscribe/unsubscribe to this list, contact
> majordomo@dutchworks.nl
>        Name: hpux-admin@dutchworks.nl     Owner:
> owner-hpux-admin@dutchworks.nl
>
>  Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP,
browse
> only)
>             http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse &
> search)
>
>
--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact
majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner:
owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse
only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse &
search)
--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:52 EDT