Sponsored Content
Full Discussion: Adding array element in KSH
Top Forums Shell Programming and Scripting Adding array element in KSH Post 302269418 by Shoeless_Mike on Wednesday 17th of December 2008 03:20:43 PM
Old 12-17-2008
Bump - please help
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shift array element

I want to delete and 0th element of array in shell scrpit and also shift all others to one level up. (2 Replies)
Discussion started by: darshakraut
2 Replies

2. Shell Programming and Scripting

Problem to initialize ksh array when first element includes hyphen

Hi I'm trying to create an array with variable including hyphen but ksh refuses the first element set -A allArgs set +A allArgs ${allArgs} -all set +A allArgs ${allArgs} -date set +A allArgs ${allArgs} test ./test.ksh: -all: bad option(s) It happens only when first element is like... (4 Replies)
Discussion started by: gdan2000
4 Replies

3. Emergency UNIX and Linux Support

Assigning zero to element of ksh array.

set -A matched #find referenced files. for i in ${file_names_html} do counter_j=0 for j in ${file_names_minus_index} do match=`cat $i | grep... (1 Reply)
Discussion started by: robin_simple
1 Replies

4. Shell Programming and Scripting

ksh insert element in array

Hi all, I need help with the following scenario in ksh. If the number of elements contained by arrayA is 11 I need to insert a zero as the element arrayA then print all arrayA elements separated by comma. Appreciate your help. (9 Replies)
Discussion started by: ejianu
9 Replies

5. Shell Programming and Scripting

Not able to call an element from an array in ksh

Hi, I have: # Initialize variables #!/usr/bin/ksh FILENM=$1 INDEX=0 # read filename echo "You are working with the Config file: $FILENM" while read line do echo $line data=$line ((INDEX=INDEX+1)) done <"$FILENM" (3 Replies)
Discussion started by: Marc G
3 Replies

6. Shell Programming and Scripting

File names as array element in ksh

Hi, I have an ksh array(ARR). the elements to the array are file names. i need to go to each file in the array and manipulate the records. for name in ${files}; do ---this loop is for all the file names in the array for i in $(wc -l < $name); do --this loop is for all the records in... (20 Replies)
Discussion started by: usrrenny
20 Replies

7. UNIX for Advanced & Expert Users

Array Element

This question is for someone that's more familiar with Array Element. I need to know if the maximum array element that can be assigned is 1024 and if its so, Is there a workaround solution when the counter exceeded 1024? param_array="$param_nam" counter=$counter+1 #to avoid space... (3 Replies)
Discussion started by: cumeh1624
3 Replies

8. Shell Programming and Scripting

Adding an element to a bash array with a variable

Hello, I have a simple task and I am having some trouble with the syntax. I have a variable with an assigned value, CMD_STRING='-L 22 -s 0 -r -O -A i -N 100 -n' I would like to add that variable to an array. As far as I have been able to look up, the syntax should be something like, ... (4 Replies)
Discussion started by: LMHmedchem
4 Replies

9. Shell Programming and Scripting

Adding character and append last element of second column

Hi, could you help me in processing this file under bash? I need to add some text to the first line and then append the last element of the second columns. The input file is tab separated while the output should be space separated. input file is 1.00E-02 2.00E-02 4.465E+17 2.00E-02 3.00E-02... (4 Replies)
Discussion started by: f_o_555
4 Replies

10. UNIX for Beginners Questions & Answers

Adding to an array in an external file, and adding elements to it.

I have an array in an external file, "array.txt", which contains: char *testarray={"Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"};I want to be able to add an element to this array, and have that element display, whenever I call it, without having to recompile... (29 Replies)
Discussion started by: ignatius
29 Replies
grab::Grab_XML(3pm)					User Contributed Perl Documentation				       grab::Grab_XML(3pm)

NAME
XMLTV::Grab_XML - Perl extension to fetch raw XMLTV data from a site SYNOPSIS
package Grab_XML_rur; use base 'XMLTV::Grab_XML'; sub urls_by_date( $ ) { my $pkg = shift; ... } sub country( $ ) { my $pkg = shift; return 'Ruritania' } # Maybe override a couple of other methods as described below... Grab_XML_rur->go(); DESCRIPTION
This module helps to write grabbers which fetch pages in XMLTV format from some website and output the data. It is not used for grabbers which scrape human-readable sites. It consists of several class methods (package methods). The way to use it is to subclass it and override some of these. METHODS
XMLTV::Grab_XML->date_init() Called at the start of the program to set up Date::Manip. You might want to override this with a method that sets the timezone. XMLTV::Grab_XML->urls_by_date() Returns a hash mapping YYYYMMDD dates to a URL where listings for that date can be downloaded. This method is abstract, you must override it. Arguments: the command line options for --config-file and --quiet. XMLTV::Grab_XML->xml_from_data(data) Given page data for a particular day, turn it into XML. The default implementation just returns the data unchanged, but you might override it if you need to decompress the data or patch it up. XMLTV::Grab_XML->configure() Configure the grabber if needed. Arguments are --config-file option (or undef) and --quiet flag (or undef). This method is not provided in the base class; if you don't provide it then attempts to --configure will give a message that configuration is not necessary. XMLTV::Grab_XML->nextday(day) Bump a YYYYMMDD date by one. You probably shouldn't override this. XMLTV::Grab_XML->country() Return the name of the country you're grabbing for, used in usage messages. Abstract. XMLTV::Grab_XML->usage_msg() Return a command-line usage message. This calls "country()", so you probably need to override only that method. XMLTV::Grab_XML->get() Given a URL, fetch the content at that URL. The default implementation calls XMLTV::Get_nice::get_nice() but you might want to override it if you need to do wacky things with http requests, like cookies. Note that while this method fetches a page, "xml_from_data()" does any further processing of the result to turn it into XML. XMLTV::Grab_XML->go() The main program. Parse command line options, fetch and write data. Most of the options are fairly self-explanatory but this routine also calls the XMLTV::Memoize module to look for a --cache argument. The functions memoized are those given by the "cachables()" method. XMLTV::Grab_XML->cachables() Returns a list of names of functions which could reasonably be memoized between runs. This will normally be whatever function fetches the web pages - you memoize that to save on repeated downloads. A subclass might want to add things to this list if it has its own way of fetching web pages. XMLTV::Grab_XML->remove_early_stop_times() Checks each stop time and removes it if it's before the start time. Argument: the XML to correct Returns: the corrected XML AUTHOR
Ed Avis, ed@membled.com SEE ALSO
perl(1), XMLTV(3). perl v5.14.2 2006-01-08 grab::Grab_XML(3pm)
All times are GMT -4. The time now is 06:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy