Sponsored Content
Full Discussion: Reference Variable
Top Forums Shell Programming and Scripting Reference Variable Post 302138421 by cchaloux on Monday 1st of October 2007 01:25:23 PM
Old 10-01-2007
Question Reference Variable

Hi!

I need to determin the most efficient way to do something (rather simple, I thought).

I'm currently echo(ing) a series of menu options, and reading the command input as the number associated with the entry. What I need to do is when the option 1 is selected, that it references a list and then fills in the variable the correct way.

Example - if I have a friendly list of server names like:

1. Server 1
2. Server 2
(...and so on)

However, in the command that I am envoking in the background it needs to be ipaddress : port. I don't want the IP address as the name on the menu, but it does need to be passed for the process to work correctly.

How would I do this?

Thanks!
 

9 More Discussions You Might Find Interesting

1. HP-UX

Reference Material

I'm having to write 'C' programs for a group of HP-UX 11.X systems. While I have found many 'C' reference books which I like, none of them reference using 'C' in the UNIX environment. Anyone have any good recommendations for books about 'C' programming under UNIX? Thanks. Chris (0 Replies)
Discussion started by: chrisc@nwark.ne
0 Replies

2. Shell Programming and Scripting

How to reference a variable within sed?

Hi all, How can I use sed to perform a substitution if the string that I'm going to substitute is stored in a variable: Let's say: sed 's/abcdefg/good' VS tmp="abcdefg" sed 's/$tmp/good' The second case doesn't work. Guess it's due to the single quotes on the outside. How can I... (1 Reply)
Discussion started by: rockysfr
1 Replies

3. Shell Programming and Scripting

Unix Variable Reference and Substitution

I can't seem to make what appears to be a simple substitution. I want to define a list of systems for which daily reports need to be filed systems="systemA systemC systemZ" I then want to run a loop for i in ${systems} Analyze statistics Create the reports mailx (8 Replies)
Discussion started by: mugsymark
8 Replies

4. Shell Programming and Scripting

subsequently reference variable

Hello, This is not homework. It is a question that I received on a recent interview for a linux position. Can someone shed some light on the right answer? I got it wrong. Thanks, jaysunn (3 Replies)
Discussion started by: jaysunn
3 Replies

5. Shell Programming and Scripting

BASH - Reference external variable name dynamically

Hi there, I have included an external properties file into my BASH script via the 'source' command. I am attempting to dynamically assign a variable in the BASH script, that references the variable name within the external properties file i.e. #!/bin/bash pth=${0%/*} source... (3 Replies)
Discussion started by: mjwoodford
3 Replies

6. Homework & Coursework Questions

undefined reference help

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: i know when undefined reference shows up the program is saying it is not link to that function but the problem... (1 Reply)
Discussion started by: mgyeah
1 Replies

7. Shell Programming and Scripting

Perl: accessing reference to variable inside hash.

Below is hash which contains reference to variables: my %mandatoryFields = ( 1 => \$msgtype, 2 => \$switchtype, 3 => \$card_nbr, 4 => \$natv_tran_type_code, 5 => \$amt_1 ); This... (0 Replies)
Discussion started by: som.nitk
0 Replies

8. Shell Programming and Scripting

Perl de-reference code reference variable

Guys, May i know how can we de reference the code reference variable.? my $a = sub{$a=shift;$b=shift;print "SUM:",($a+$b),"\n";}; print $a->(4,5); How can we print the whole function ? Please suggest me regarding this. Thanks for your time :) Cheers, Ranga :) (0 Replies)
Discussion started by: rangarasan
0 Replies

9. Shell Programming and Scripting

Get last reference date

Hi, Could you please help me to get last reference date in Unix, in Unix we maintain SAS7BDAT files. Is there any command or script to get the info, Thank you. (2 Replies)
Discussion started by: subbarao12
2 Replies
Net::Server::MultiType(3)				User Contributed Perl Documentation				 Net::Server::MultiType(3)

NAME
Net::Server::MultiType - Net::Server personality SYNOPSIS
use Net::Server::MultiType; @ISA = qw(Net::Server::MultiType); sub process_request { #...code... } my @types = qw(PreFork Fork Single); Net::Server::MultiType->run(server_type=>@types); DESCRIPTION
Please read the pod on Net::Server first. This module is a personality, or extension, or sub class, of the Net::Server module. This personality is intended to allow for easy use of multiple Net::Server personalities. Given a list of server types, Net::Server::MultiType will require one at a time until it finds one that is installed on the system. It then adds that package to its @ISA, thus inheriting the methods of that personality. ARGUMENTS
In addition to the command line arguments of the Net::Server base class, Net::Server::MultiType contains one other configurable parameter. Key Value Default server_type 'server_type' 'Single' server_type May be called many times to build up an array or possible server_types. At execution, Net::Server::MultiType will find the first available one and then inherit the methods of that personality CONFIGURATION FILE
"Net::Server::MultiType" allows for the use of a configuration file to read in server parameters. The format of this conf file is simple key value pairs. Comments and white space are ignored. #-------------- file test.conf -------------- ### multi type info ### try PreFork first, then go to Single server_type PreFork server_type Single ### server information min_servers 20 max_servers 80 spare_servers 10 max_requests 1000 ### user and group to become user somebody group everybody ### logging ? log_file /var/log/server.log log_level 3 pid_file /tmp/server.pid ### access control allow .+.(net|com) allow domain.com deny a.+ ### background the process? background 1 ### ports to bind host 127.0.0.1 port localhost:20204 port 20205 ### reverse lookups ? # reverse_lookups on #-------------- file test.conf -------------- PROCESS FLOW
See Net::Server HOOKS
There are no additional hooks in Net::Server::MultiType. TO DO
See Net::Server AUTHOR
Paul T. Seamons paul@seamons.com SEE ALSO
Please see also Net::Server::Fork, Net::Server::INET, Net::Server::PreFork, Net::Server::MultiType, Net::Server::Single perl v5.12.1 2007-02-02 Net::Server::MultiType(3)
All times are GMT -4. The time now is 10:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy