When setting a variable, how would I go about making each result a new line?
A very simple example would be:
This gives me all the folders as one variable and I need to be able to use each as its own variable. I'm sure I have to make this into an array, but I have no idea how to do that, and be able to use an element of the array later in the script.
We just purchased a MOD30 disk array strage system.
We have 15 drives and 2 hot spares.
We're running a database app with 8 data sets.
I'm trying to get the best i/o speed out of my disk configuration.
Right now I have 3 raid5 arrays setup. This seems to offer the same performance as having the... (1 Reply)
Hi all,
I have a question does anyone know if it is possible to push or pop an array in the ksh environment? Could anyone give me a hint, because I am trying to merge 2 server files together and there are some names in the server is not proper anymore.
Thank you in advance. (4 Replies)
suppose my @{$data1{$callid}}; cotains
one two three
three five six
one two three
of random patterns but each item is separated by white space or tab,
Below code extract and get rid of the whitespace perfectly so that it shows now like this
onetwothree
threefivesix... (2 Replies)
I need to implement the following logic and need some expert help from UNIX community.
These are the steps in my Shell script.
1. Analyze a file.
2. Extract all the ID's in that file.
3. Use the ID's from #2 to run another filter on the file.
I've implemented # 1 and 2 using... (3 Replies)
Greetings,
DISCLAIMER: My shell scripting is rusty so my question may be borderline stupid. You've been warned.
I need to create a script that a) lists the content of zip files in a directory and b) sends out an `exception` report. My ZIP files contain a control file (for load check). I want... (2 Replies)
Im new to C programming and am having trouble understanding the output of this code
int array={4,5,8,9,8,1,0,1,9,3};
int *array_ptr;
int main()
{
array_ptr=array;
while((*array_ptr) != 0)
array_ptr++;;
printf("%d\n", array_ptr - array);
return(0);
}
the output is 6 but I... (2 Replies)
I have attempted to create an array consisting of two items: #0 and #1.
I am able to print the two items corrctly:
arr=(hello "my name is")
echo ${arr}
hello
echo ${arr}
my name is
However, when I try to run a for loop to print both objects:
for i in ${arr
}
do
echo $i
done
I get:... (2 Replies)
Hi,
I am trying to do something similar to the for loop example from KSH For Loop Array: Iterate Through Array Values
$: cat y.ksh
#!/bin/ksh
# set array called nameservers
set -A nameservers 192.168.1.1 192.168.1.5 202.54.1.5
# print all name servers
for i in ${nameservers}
do
... (3 Replies)
Inside a zsh function, I create a local array with local -a arrayname and a local associative array with local -A arrayname.
I also can create an array using set, like this:
set -A arrayname value1 value2 value3In this form, I can not explicitly declare that an array is associative or... (2 Replies)
I am trying to assign indexes to an associative array in a for loop but I have to use an eval command to make it work, this doesn't seem correct I don't have to do this with regular arrays
For example, the following assignment fails without the eval command:
#! /bin/bash
read -d "\0" -a... (19 Replies)
Discussion started by: Riker1204
19 Replies
LEARN ABOUT OPENDARWIN
tcl_upvar2
Tcl_UpVar(3) Tcl Library Procedures Tcl_UpVar(3)__________________________________________________________________________________________________________________________________________________NAME
Tcl_UpVar, Tcl_UpVar2 - link one variable to another
SYNOPSIS
#include <tcl.h>
int
Tcl_UpVar(interp, frameName, sourceName, destName, flags)
int
Tcl_UpVar2(interp, frameName, name1, name2, destName, flags)
ARGUMENTS
Tcl_Interp *interp (in) Interpreter containing variables; also used for error reporting.
CONST char *frameName (in) Identifies the stack frame containing source variable. May have any of the forms accepted by
the upvar command, such as #0 or 1.
CONST char *sourceName (in) Name of source variable, in the frame given by frameName. May refer to a scalar variable or
to an array variable with a parenthesized index.
CONST char *destName (in) Name of destination variable, which is to be linked to source variable so that references to
destName refer to the other variable. Must not currently exist except as an upvar-ed vari-
able.
int flags (in) Either TCL_GLOBAL_ONLY or 0; if non-zero, then destName is a global variable; otherwise it
is a local to the current procedure (or global if no procedure is active).
CONST char *name1 (in) First part of source variable's name (scalar name, or name of array without array index).
CONST char *name2 (in) If source variable is an element of an array, gives the index of the element. For scalar
source variables, is NULL.
_________________________________________________________________DESCRIPTION
Tcl_UpVar and Tcl_UpVar2 provide the same functionality as the upvar command: they make a link from a source variable to a destination
variable, so that references to the destination are passed transparently through to the source. The name of the source variable may be
specified either as a single string such as xyx or a(24) (by calling Tcl_UpVar) or in two parts where the array name has been separated
from the element name (by calling Tcl_UpVar2). The destination variable name is specified in a single string; it may not be an array ele-
ment.
Both procedures return either TCL_OK or TCL_ERROR, and they leave an error message in the interpreter's result if an error occurs.
As with the upvar command, the source variable need not exist; if it does exist, unsetting it later does not destroy the link. The desti-
nation variable may exist at the time of the call, but if so it must exist as a linked variable.
KEYWORDS
linked variable, upvar, variable
Tcl 7.4 Tcl_UpVar(3)