Sponsored Content
Full Discussion: Output of shell in array
Top Forums Shell Programming and Scripting Output of shell in array Post 302525430 by purdym on Thursday 26th of May 2011 04:21:42 PM
Old 05-26-2011
I've thought about releasing the code, I spent a lot of time developing it. I can't guarantee its bug free. Perhaps someone has time see if it works on their system.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

output of an array

Hi gurus, I need to set up an array like this set - A arr 'A', 'B' The output of this array should be like this 'A','B' Right now, I get the output like this 'A B' Can anyone suggest me on how to achieve this. thanks (3 Replies)
Discussion started by: ragha81
3 Replies

2. Shell Programming and Scripting

Put output into an array

I'm trying to take the output of an environment that has multiple strings ex. # echo $SSH_CLIENT 192.168.1.1 57039 22 I need that IP... so I can set it to another environment. Thank you (3 Replies)
Discussion started by: adelsin
3 Replies

3. Filesystems, Disks and Memory

iostat output vs TPC output (array layer)

Hi Guys, I've been having some arguments with my colleagues about one thing. Always my thought was that as as far as disk performance is concern by looking at the output of the iostat command (AIX) you would be able to identify if you have a hot disk and then by moving some files out that disk... (3 Replies)
Discussion started by: arizah
3 Replies

4. Shell Programming and Scripting

Sorting awk array output?

Hi all, I have a script which produces a nice table but I want to sort it on column 3. This is the output line in the script: # Output { FS = ":"; format = "%11s %6s %-16s\n"; prinft "\n" printf ( format, "Size","Count","Who" ) } for (i in... (21 Replies)
Discussion started by: Cowardly
21 Replies

5. Shell Programming and Scripting

Output file list to array?

Hey, guys, scripting newb here. I'm trying to get a list of all .dmg files in a folder and save the output into an array. My first attempt was ARRAY= ( `ls $REIMAGEPATH | grep \.dmg$` ) However, I understand why that doesn't work now (at least I think I do). But I don't know what the... (5 Replies)
Discussion started by: nextyoyoma
5 Replies

6. Shell Programming and Scripting

Store the output values in array

Hi, How to store the values in array from output result, EG: I have the result like this, ps, google, 1.txt, 1 sam, google, 2.txt, 2 These are the four values followed by comma in two sets. I need to store these values set by set. One set contains four values followed by comma. ... (2 Replies)
Discussion started by: KarthikPS
2 Replies

7. Shell Programming and Scripting

Output find to array

Hi I'm trying to write a shell script which finds all the .zip files in a given directory then lists them on the screen and prompts the user to select one by entering a number e.g. The available files are: 1. HaveANiceDay.zip 2. LinuxHelp.zip 3. Arrays.zip Please enter the... (4 Replies)
Discussion started by: zX TheRipper Xz
4 Replies

8. UNIX for Dummies Questions & Answers

Formatting Array Output

Hello All, Q1) I have the below code but when the email was sent out all lines are merged and coming out as a single line though my printf statement has newline "\n", How do i avoid that? Q2) In my second IF statement when i introduced the backslash "\" for continuation of a line or command, i... (10 Replies)
Discussion started by: Ariean
10 Replies

9. Shell Programming and Scripting

How to Assign an shell array to awk array?

Hello All, Can you please help me with the below. #!/bin/bash ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5 EXTRACT_DT:30-SEP-12 VER_NUM:1" ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5... (14 Replies)
Discussion started by: Ariean
14 Replies

10. Shell Programming and Scripting

Pass C shell array to another C shell script(csh) and shell(sh)

Dear Friends, Please help me on this my script name is send.csh In this i have written the statement like this set args = ( city state country price ) I want to pass this array to another c shell called receiver.csh. and i want to use it in this c shell or how to pass to... (2 Replies)
Discussion started by: SA_Palani
2 Replies
Devel::NYTProf::Core(3pm)				User Contributed Perl Documentation				 Devel::NYTProf::Core(3pm)

NAME
Devel::NYTProf::Core - load internals of Devel::NYTProf DESCRIPTION
This module is not meant to be used directly. See Devel::NYTProf, Devel::NYTProf::Data, and Devel::NYTProf::Reader. While it's not meant to be used directly, it is a handy place to document some internals. SUBROUTINE PROFILER
The subroutine profiler intercepts the "entersub" opcode which perl uses to invoke a subroutine, both XS subs (henceforth xsubs) and pure perl subs. The following sections outline the way the subroutine profiler works: Before the subroutine call The profiler records the current time, the current value of cumulative_subr_secs (as initial_subr_secs), and the current cumulative_overhead_ticks (as initial_overhead_ticks). The statement profiler measures time at the start and end of processing for each statement (so time spent in the profiler, writing to the file for example, is excluded.) It accumulates the measured overhead into the cumulative_overhead_ticks variable. In a similar way, the subroutine profiler measures the exclusive time spent in subroutines and accumulates it into the cumulative_subr_secs global. Make the subroutine call The call is made by executing the original perl internal code for the "entersub" opcode. Calling a perl subroutine If the sub being called is a perl sub then when the entersub opcode returns, back into the subroutine profiler, the subroutine has been 'entered' but the first opcode of the subroutine hasn't been executed yet. Crucially though, a new scope has been entered by the entersub opcode. The subroutine profiler then pushes a destructor onto the context stack. The destructor is effectively just inside the sub, like a "local", and so will be triggered when the subroutine exits by any means. Also, because it was the first thing push onto the context stack, it will be triggered after any activity caused by the subroutines scope exiting. When the destructor is invoked it calls a function which completes the measurement of the time spent in the sub (see below). In this way the profiling of perl subroutines is very accurate and robust. Calling an xsub If the sub being called is an xsub, then control doesn't return from the entersub opcode until the xsub has returned. The profiler detects this and calls the function which completes the measurement of the time spent in the xsub. So far so good, but there's a problem. What if the xsub doesn't return normally but throws an exception instead? In that case (currently) the profiler acts as if the xsub was never called. Time spent inside the xsub will be allocated to the calling sub. Completing the measurement The function which completes the timing of a subroutine call does the following: It calculates the time spent in the statement profiler: overhead_ticks = cumulative_overhead_ticks - initial_overhead_ticks and subtracts that from the total time spent 'inside' the subroutine: incl_subr_sec = (time now - time call was made) - overhead_ticks That gives us an accurate inclusive time. To get the exclusive time it calculates the time spent in subroutines called from the subroutine call we're measuring: called_sub_secs = cumulative_subr_secs - initial_subr_secs and subtracts that from the incl_subr_sec: excl_subr_sec = incl_subr_sec - called_sub_secs To make that easier to follow, consider a call to a sub that calls no others. In that case cumulative_subr_secs remains unchanged during the call, so called_sub_secs is zero, and excl_subr_sec is the same as incl_subr_sec. Finally, it adds the exclusive time to the cumulative exclusive time: cumulative_subr_secs += excl_subr_sec AUTHOR
Tim Bunce, <http://www.tim.bunce.name> and <http://blog.timbunce.org> COPYRIGHT AND LICENSE
Copyright (C) 2008, 2009 by Tim Bunce. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available. perl v5.14.2 2010-11-19 Devel::NYTProf::Core(3pm)
All times are GMT -4. The time now is 11:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy