[HPADM] Re: Scripting question - functions

From: Samuel G. Cristobal (samuel.guinales@hp.com)
Date: Thu Apr 06 2006 - 09:32:32 EDT


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)


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