Sponsored Content
Top Forums Shell Programming and Scripting Unable to set a data to array Post 302262690 by kiranlalka on Friday 28th of November 2008 11:05:49 AM
Old 11-28-2008
Error Unable to set a data to array

Hi All,

Iam trying to set the value to the array... Still its not happening

Following is the code:

#!/usr/bin/ksh

filenames[0]="x";
filenames[1]="y";
echo $filenames[0];
echo $filenames[1];

O/P:

x[0]
x[1]


Iam expecting
x
y

Can some one help me
 

9 More Discussions You Might Find Interesting

1. Linux

DNS unable to set up!!

Hi Experts, I am a newbie like in Linux world, practising Fedora Linux on VMWare but DNS is never set up: Below are my conf files: 1. named.conf options { directory "/var/named"; /* * If there is a firewall between you and nameservers you want * to talk... (4 Replies)
Discussion started by: vikasdh
4 Replies

2. AIX

Unable to set remote printer in AIX

Hi all, I am a beginner in AIX. I am facing a problem with remote printing in AIX. HP laser jet 1320 printer is connected to a printer server (PCI Mini - 100U3), which is configured as remote printer from AIX server. But I am not able to print from the AIX server by using "lp -d... (0 Replies)
Discussion started by: Rainy
0 Replies

3. UNIX for Dummies Questions & Answers

unable to set user home dir

I created a new user and changed their home directory to /export/home/mydir/ I verified in the passwd file that the home directory is set to the above and that owner of that directory is the new user and yet when I log in as that user I get the following message: No directory! Logging in with... (14 Replies)
Discussion started by: some_one
14 Replies

4. Solaris

Solaris 9 -- unable to set permanent PATH

Hi, I've read forums far and wide trying to learn how to append to my PATH in Solaris 9 and every time I think I am close I discover my system is not configured the same. Its so frustrating because this all stems from a new server I am trying to setup identical to the production machine. (Of... (5 Replies)
Discussion started by: thoraddict
5 Replies

5. Shell Programming and Scripting

Unable to set variables in Linux script

Hi, I am pretty new in writing shell script on LINUX, I tried to write the script just like KSH on HP unix but it seems nothing is working. Even assigning variables seems to be not working as KSH on HP unix. Please help in resolving the issues I am facing on LINUX. I have declared variables for... (5 Replies)
Discussion started by: smr.ryl
5 Replies

6. Shell Programming and Scripting

Unable to set my PATH variable

Hello All, Hope you can understand my problem from the below code. $ cat ~/.profile PS1=`whoami`@`hostname`':$PWD $ ' export PATH="$PATH:.:/logarchive/utility/util:/usr/sbin:" $ echo $PATH /usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:.:/usr/sbin: $ echo $SHELL /usr/bin/ksh ... (6 Replies)
Discussion started by: sathyaonnuix
6 Replies

7. Shell Programming and Scripting

Unable to set PATH through ksh shell

I'm trying to set path for the current session but it is not doing so. It works perfectly on command line though. #!/usr/bin/ksh PATH=$PATH:/opt/quest/bin Is there any specific way to set path on korn? (3 Replies)
Discussion started by: pjeedu2247
3 Replies

8. Shell Programming and Scripting

Unable to set Global variable outside while loop

Below is my code: count=0 if ... ... else ... find * -prune -type d | sort -r -n | while read d; do count=1 if ; then echo "Count1:$count" ... ... break 2; fi ... done ... fi echo "Count2:$count" (9 Replies)
Discussion started by: mohtashims
9 Replies

9. Linux

Unable to set static ip address

Hi All, Am using centos 7 in my vmware workstatio with the bridged network. when run the ifconfig cmd its not at all showing the ip address and pls advise how to set static ip address in my linux box. (1 Reply)
Discussion started by: sarathkumar s
1 Replies
Glib::OptionGroup(3)					User Contributed Perl Documentation				      Glib::OptionGroup(3)

NAME
Glib::OptionGroup HIERARCHY
Glib::Boxed +----Glib::OptionGroup METHODS
optiongroup = Glib::OptionGroup->new (key => value, ...) Creates a new option group from the given key-value pairs. The valid keys are name, description, help_description, and entries. The first three specify strings while the last one, entries, specifies an array reference of option entries. Example: my $group = Glib::OptionGroup->new ( name => 'urgs', description => 'Urgs Urgs Urgs', help_description => 'Help with Urgs', entries => @entries); An option entry is a hash reference like this: { long_name => 'verbose', short_name => 'v', flags => [qw/reverse hidden in-main/], arg_type => 'none', arg_value => $verbose, description => 'verbose desc.', arg_description => 'verbose arg desc.' } Of those keys only long_name, arg_type, and arg_value are required. So this is a valid option entry too: { long_name => 'package-names', arg_type => 'string-array', arg_value => $package_names } For convenience, option entries can also be specified as array references containing long_name, short_name, arg_type, and arg_value: [ 'filenames', 'f', 'filename-array', $filenames ] If you don't want an option to have a short name, specify undef for it: [ 'filenames', undef, 'filename-array', $filenames ] $group->set_translate_func ($func, $data=undef) o $func (scalar) o $data (scalar) $group->set_translation_domain ($domain) o $domain (string) ENUMS AND FLAGS
enum Glib::OptionArg o 'none' / 'G_OPTION_ARG_NONE' o 'string' / 'G_OPTION_ARG_STRING' o 'int' / 'G_OPTION_ARG_INT' o 'filename' / 'G_OPTION_ARG_FILENAME' o 'string-array' / 'G_OPTION_ARG_STRING_ARRAY' o 'filename-array' / 'G_OPTION_ARG_FILENAME_ARRAY' o 'double' / 'G_OPTION_ARG_DOUBLE' o 'int64' / 'G_OPTION_ARG_INT64' flags Glib::OptionFlags o 'hidden' / 'G_OPTION_FLAG_HIDDEN' o 'in-main' / 'G_OPTION_FLAG_IN_MAIN' o 'reverse' / 'G_OPTION_FLAG_REVERSE' o 'no-arg' / 'G_OPTION_FLAG_NO_ARG' o 'filename' / 'G_OPTION_FLAG_FILENAME' o 'optional-arg' / 'G_OPTION_FLAG_OPTIONAL_ARG' o 'noalias' / 'G_OPTION_FLAG_NOALIAS' SEE ALSO
Glib, Glib::Boxed COPYRIGHT
Copyright (C) 2003-2009 by the gtk2-perl team. This software is licensed under the LGPL. See Glib for a full notice. perl v5.12.1 2010-07-05 Glib::OptionGroup(3)
All times are GMT -4. The time now is 04:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy