Sponsored Content
Full Discussion: Dynamic Array Issue
Top Forums Shell Programming and Scripting Dynamic Array Issue Post 302110274 by ddedic on Sunday 11th of March 2007 10:38:03 PM
Old 03-11-2007
thank you for your prompt response. This is exactly what I was looking for. Thank you.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

creating a dynamic array in ksh

Hi, Is it possible to create a dynamic array in shell script. I am trying to get the list of logfiles that created that day and put it in a dynamic array. I am not sure about it. help me New to scripting Gundu (3 Replies)
Discussion started by: gundu
3 Replies

2. Programming

(MPI) Segmentation fault with dynamic allocated 2D array

Hi all, I'm getting segmentation fault errors when I try to send/receive 2 rows of a matrix as a block, and I can't figure out why. Basically, I have a 4x5 matrix with an extra top row and an extra leftmost column, making it a (4+1)x(5+1) matrix stored in P0. I'm trying to send the 2nd and 3rd... (1 Reply)
Discussion started by: lancer6238
1 Replies

3. Shell Programming and Scripting

creating a dynamic array

i want to create an array the array elements are populated depending upon the number of entries present in a data file The data file is created dynamically how to achieve the same thanks (1 Reply)
Discussion started by: trichyselva
1 Replies

4. Programming

Creating an array to hold posix thread ids: Only dynamic array works

I am facing a strange error while creating posix threads: Given below are two snippets of code, the first one works whereas the second one gives a garbage value in the output. Snippet 1 This works: -------------- int *threadids; threadids = (int *) malloc (num_threads * sizeof(int)); ... (4 Replies)
Discussion started by: kmehta
4 Replies

5. Programming

array dynamic allocation

Hi, I have the following problem: i must allocate a dynamic array from a subroutine which should return such array to main function. The subroutine has already a return parameter so i thought of pass the array as I/O parameter. I tried the following program but it doesn't work (segmentation... (11 Replies)
Discussion started by: littleboyblu
11 Replies

6. Shell Programming and Scripting

dynamic index for array in while loop

Hi, I'm just trying to use a dynamic index for some array elements that I'm accessing within a loop. Specifically, I want to access an array at variable position $counter and then also at location $counter + 1 and $counter + 2 (the second and third array positions after it) but I keep getting... (0 Replies)
Discussion started by: weak_code-fu
0 Replies

7. Shell Programming and Scripting

Assigning values for a dynamic array for an input

Hello, Can somebody please give me a snippet for the below requirement. I want to assign the values separeted by a comma to be assigned to a dynamic array. If I give an input (read statement) like abc1,abc2,abc3,abc4,abc5, all these strings abc* should be assigned to an array like below... (2 Replies)
Discussion started by: suneelj
2 Replies

8. Programming

readdir and dynamic array memory corruption

Hi everyone I am developing an utility. At some part of it I read directory entries to a dynamic array: struct list It stores pointers to items: list.entries, which are structures: struct entry If a number of files in a directory is greater then number of elements an array was initially... (11 Replies)
Discussion started by: torbium
11 Replies

9. Shell Programming and Scripting

Help w/ Reading Matrix & Storing in dynamic array

First of I would just like to state that I am not looking for you guys to just do my work for me, I do want to learn and actually understand everything that is happening. Hey all, I am having trouble on this. What I need to do is... Write an executable C file that will take a text file (not a... (8 Replies)
Discussion started by: innvert
8 Replies

10. Programming

Memory corruption in dynamic array of strings

I put together a C function to add strings to a dynamic array of strings (mostly for educational purpose to explain pointers to my kid). It works, but sometimes one or two strings in the array becomes corrupted. Running example on 64 bit Ubuntu, gcc ver. 4.8.4 Hope my code is self-explanatory: ... (2 Replies)
Discussion started by: migurus
2 Replies
cktime(1)							   User Commands							 cktime(1)

NAME
cktime, errtime, helptime, valtime - display a prompt; verify and return a time of day SYNOPSIS
cktime [-Q] [-W width] [-f format] [-d default] [-h help] [-e error] [-p prompt] [-k pid [-s signal]] /usr/sadm/bin/errtime [-W width] [-e error] [-f format] /usr/sadm/bin/helptime [-W width] [-h help] [-f format] /usr/sadm/bin/valtime [-f format] input DESCRIPTION
The cktime utility prompts a user and validates the response. It defines, among other things, a prompt message whose response should be a time, text for help and error messages, and a default value (which is returned if the user responds with a RETURN). The user response must match the defined format for the time of day. All messages are limited in length to 70 characters and are formatted automatically. Any white space used in the definition (including NEW- LINE) is stripped. The -W option cancels the automatic formatting. When a tilde is placed at the beginning or end of a message definition, the default text is inserted at that point, allowing both custom text and the default text to be displayed. If the prompt, help or error message is not defined, the default message (as defined under NOTES) is displayed. Three visual tool modules are linked to the cktime command. They are errtime (which formats and displays an error message), helptime (which formats and displays a help message), and valtime (which validates a response). These modules should be used in conjunction with FML objects. In this instance, the FML object defines the prompt. When format is defined in the errtime and helptime modules, the messages will describe the expected format. OPTIONS
The following options are supported: -d default Defines the default value as default. The default is not validated and so does not have to meet any criteria. -e error Defines the error message as error. -f format Specifies the format against which the input will be verified. Possible formats and their definitions are: %H = hour (00 - 23) %I = hour (00 - 12) %M = minute (00 - 59) %p = ante meridian or post meridian %r = time as %I:%M:%S %p %R = time as %H:%M (the default format) %S = seconds (00 - 59) %T = time as %H:%M:%S -h help Defines the help messages as help. -k pid Specifies that process ID pid is to be sent a signal if the user chooses to abort. -p prompt Defines the prompt message as prompt. -Q Specifies that quit will not be allowed as a valid response. -s signal Specifies that the process ID pid defined with the -k option is to be sent signal signal when quit is chosen. If no signal is specified, SIGTERM is used. -W width Specifies that prompt, help and error messages will be formatted to a line length of width. OPERANDS
The following operand is supported: input Input to be verified against format criteria. EXIT STATUS
The following exit values are returned: 0 Successful execution. 1 EOF on input, or negative width on -W option, or usage error . 3 User termination (quit) . 4 Garbled format argument. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5) NOTES
The default prompt for cktime is: Enter a time of day [?,q]: The default error message is: ERROR: Please enter the time of day. Format is <format>. The default help message is: Please enter the time of day. Format is <format>. When the quit option is chosen (and allowed), q is returned along with the return code 3. The valtime module will not produce any output. It returns 0 for success and non-zero for failure. SunOS 5.11 14 Sep 1992 cktime(1)
All times are GMT -4. The time now is 10:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy