Sponsored Content
Full Discussion: function parameter issue
Top Forums UNIX for Dummies Questions & Answers function parameter issue Post 302493499 by amar1003 on Wednesday 2nd of February 2011 11:40:14 PM
Old 02-03-2011
hi zaxxon,
no luck.even now it is not picking the value.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing a string parameter to a function

I need to pass a parameter to a function in a script. My parameter is a string. When I display the parameter within my function, I only get the first word from string I pass in. How can I make the function receive the whole string (and not terminate at the first space it encounters)?. part of... (1 Reply)
Discussion started by: fastgoon
1 Replies

2. UNIX for Advanced & Expert Users

Parameter passing in a function

I need to pass a parameter to a function in a script. My parameter is a string. When I display the parameter within my function, I only get the first word from string I pass in. How can I make the function receive the whole string (and not terminate at the first space it encounters)?. part of... (2 Replies)
Discussion started by: fastgoon
2 Replies

3. Shell Programming and Scripting

function parameter

Hi, i have this code : awk -v s=string_to_find 'BEGIN{ n="" } { if ($0 ~ /FEATURE TESTED /) { n=$0 } if (index($0,s)!=0) { if (n!="") print n n=="" } }' $file1 > $file2 (4 Replies)
Discussion started by: kamel.seg
4 Replies

4. Shell Programming and Scripting

KSH list as function parameter

Hello, Could anyone help me with some KSH syntax? I'm trying to pass a list as a function parameter in a KSH? For example I have code like this: print_counter() { N=$1 C=$2 for A in $C; do echo "This is $N number $A" done } NAME=BRICK COUNT=" 1 2 3 4" ... (2 Replies)
Discussion started by: pn8830
2 Replies

5. Shell Programming and Scripting

pass parameter to function

HI all I have a code like ############################################## minyear() { curryear=$1 echo $curryear } ##Main Program ## minyear exit ####### when i execute "sh scriptname 2005" output should be like 2005 but the output is blank. I guess i need to pass parameter to... (3 Replies)
Discussion started by: vasuarjula
3 Replies

6. Shell Programming and Scripting

How to use parameter with perl function?

am a beginer of shell Unix, plesase tell me how to get parameter with $perl in loop $ perl -lne '$/="DOCEND";print $_."DOCEND" if /$ACC/' file_input > output i can't get parameter in loop with perl fucntion like this pass paramerter to $ACC not accept in this script $ACC = paramerter to... (4 Replies)
Discussion started by: krai
4 Replies

7. Solaris

function parameter in unix

Hi, How to use a function with passing value as a parameter in unix ? With Regards (7 Replies)
Discussion started by: milink
7 Replies

8. Shell Programming and Scripting

Pass command as a function parameter

Hi guys, can someome help with this question, I have defined a function that takes a command as a parameter, but when the command is executed from the function it will throw errors because what I believe is a special character escaping issue. I tried using the backslash to escape the pipe | and >... (2 Replies)
Discussion started by: marouanix
2 Replies

9. Shell Programming and Scripting

Passing command as a function parameter

Hi All, Just trying to implement the below shell script using AIX ksh shell. myfunc { eval "$*" } CMD='ls -la /etc/hosts | awk '{print $9"|"$5}'' myfunc $CMD Keeping getting "|}: not found" errors, any pointers would greatly be appreciated. Kind Regards Ed Please... (2 Replies)
Discussion started by: eo29
2 Replies

10. Shell Programming and Scripting

How to pass function parameter to do loop?

Hi All, I have created one function for KSH and was running well with one parameter input since I just had to use $1 to get the parameter. Now I want to do loop for each parameter(actually filenames) . I have try to use do loop, but $i does not resolve to parameter instead it resolves to 1,... (5 Replies)
Discussion started by: mysocks
5 Replies
Chart::Clicker::Drawing::ColorAllocator(3pm)		User Contributed Perl Documentation	      Chart::Clicker::Drawing::ColorAllocator(3pm)

NAME
Chart::Clicker::Drawing::ColorAllocator - Color picker VERSION
version 2.83 SYNOPSIS
use Graphics::Color::RGB; use Chart::Clicker::Drawing::ColorAllocator; my $ca = Chart::Clicker::Drawing::ColorAllocator->new({ colors => [ Graphics::Color::RGB->new( red => 1.0, green => 0, blue => 0, alpha => 1.0 ), #... ] }); my $red = $ca->get(0); #or let Chart::Clicker autmatically pick complementing colors for you my $ca2 = Chart::Clicker::Drawing::ColorAllocator->new({ seed_hue => 0, #red }); DESCRIPTION
Allocates colors for use in the chart. The position in the color allocator corresponds to the series that will be colored. AUTOMATIC COLOR ALLOCATION
This module has the capacity to automatically allocate 96 individual colors using Color::Scheme. It does so by picking 4 hues equally spaced in the color wheel from the "seed_hue" (0 (red) would be complimented by 270 (blue), 180 (green) and 90 (yellow)). After those colors are allocated it moves on to picking from the colors between those ( 45, 135, 215, 305 ) etc. Once all values of "hues" have been utilized, it repeats them using a different shade. This has the effect of generating evenly spaced complementing colors to ensure colors are well ditinguishable from one another and have appropriate contrast. position Gets the current position. ATTRIBUTES
colors An arrayref of colors that will be used for series that Clicker draws. color_scheme A lazy-building Color::Scheme object used to generate the color scheme of the chart; seed_hue The interger value of the first hue used when computing the tetrade color scheme. Setting this will affect the hue of the first color allocated. Subsequent colors will be allocated based on their distance from this color to maintain sifficient contrast between colors. If not specified the seed_hue will default to 270, blue. hues An array reference of evenly spaced seed hues for color allocation. By default it will use the seed hue plus 0, 45, 75, 15, 60 and 30 which is enough to cover all web-safe colors when using a tetrade color scheme. shade_order An array reference of the order in which the different shades of each color will be used for every color scheme generated. It defaults to 1, 3, 0, 2 for optimum color spacing. METHODS
add_to_colors Add a color to this allocator. clear_colors Clear this allocator's colors color_count Get the number of colors in this allocator. get_color ($index) Gets the color at the specified index. Returns undef if that position has no color. next Returns the next color. Each call to next increments the position, so subsequent calls will return different colors. allocate_color Determines what the next color should be. reset Resets this allocator back to the beginning. AUTHOR
Cory G Watson <gphat@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Cold Hard Code, LLC. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-22 Chart::Clicker::Drawing::ColorAllocator(3pm)
All times are GMT -4. The time now is 10:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy