All,
I would like to add the first 10 elements of an array. Here is how I am doing it now (only included first few add ops):
#!/usr/bin/ksh
###Grab the array values out of a file###
TOTAL=`awk '/time/' /tmp/file.out | awk '{print $4}'`
set -A times $TOTAL
SUM=$((${times} + times... (3 Replies)
I have a script that generates a variable with the location of a file and its complete path. What i want to do is to "cd" to the directory where that file is located using the path name of the file. GIS has absolutely failed me.
For example when i run my script it generates a variable called... (1 Reply)
I am wondering how I can save the file names (stored in $file or $fnames) in array which I can access with an index.
alias MATH 'set \!:1 = `echo "\!:3-$" | bc -l`'
set narg = $#argv
while ($iarg < $narg)
MATH iarg = $iarg + 1
set arg = $argv
set opt = ` echo $arg | awk... (1 Reply)
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)
I wish to assign file names with particular extention to array variables. For example if there are 5 files with .dat extention in /home/sam then i have to assign these 5 files to an array.
plz help me how to accomplish this.
Thanks in advance. (4 Replies)
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)
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)
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)
#!/bin/bash
X=(2H 4S 10D QC JD 9H 8S)
How do I unset the 10D from this array and save it to a file?
Please use CODE tags as required by forum rules! (5 Replies)
Discussion started by: cogiz
5 Replies
LEARN ABOUT DEBIAN
__gnu_cxx::subtractive_rng
__gnu_cxx::subtractive_rng(3cxx)__gnu_cxx::subtractive_rng(3cxx)NAME
__gnu_cxx::subtractive_rng -
SYNOPSIS
Inherits std::unary_function< _Arg, _Result >.
Public Types
typedef _Arg argument_type
typedef _Result result_type
Public Member Functions
subtractive_rng (unsigned int __seed)
subtractive_rng ()
void _M_initialize (unsigned int __seed)
unsigned int operator() (unsigned int __limit)
Detailed Description
The subtractive_rng class is documented on SGI's site. Note that this code assumes that int is 32 bits.
Definition at line 349 of file ext/functional.
Member Typedef Documentation
template<typename _Arg, typename _Result> typedef _Arg std::unary_function< _Arg, _Result >::argument_type [inherited]
argument_type is the type of the argument
Definition at line 105 of file stl_function.h.
template<typename _Arg, typename _Result> typedef _Result std::unary_function< _Arg, _Result >::result_type [inherited]
result_type is the return type
Definition at line 108 of file stl_function.h.
Constructor & Destructor Documentation
__gnu_cxx::subtractive_rng::subtractive_rng (unsigned int__seed) [inline]
Ctor allowing you to initialize the seed.
Definition at line 391 of file ext/functional.
__gnu_cxx::subtractive_rng::subtractive_rng () [inline]
Default ctor; initializes its state with some number you don't see.
Definition at line 395 of file ext/functional.
Member Function Documentation
unsigned int __gnu_cxx::subtractive_rng::operator() (unsigned int__limit) [inline]
Returns a number less than the argument.
Definition at line 360 of file ext/functional.
Author
Generated automatically by Doxygen for libstdc++ from the source code.
libstdc++ Tue Nov 27 2012 __gnu_cxx::subtractive_rng(3cxx)