Sponsored Content
Top Forums Shell Programming and Scripting finding the last substring... Post 302095170 by cutelucks on Friday 3rd of November 2006 06:21:01 PM
Old 11-03-2006
even this doesnot work...i had previously written similarly..it doesnot work...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Getting a substring

This is probably pretty simple butI'm not sure how to best go about it. If I have FILE="myBigLongFileName_1.xls" FILE_PREFIX=`echo $FILE| cut -d"." -f1` # that gives "myBigLongFileName_1" All i want to do now is chop the "_1" from the end of $FILE_PREFIX Any ideas anyone? (3 Replies)
Discussion started by: djkane
3 Replies

2. Shell Programming and Scripting

how to get substring

i have a strings abc-def.csv ghi-jkl.csv i want to make it as abc-*-def.xyz ghi-*-jkl.xyz How to do it?. (5 Replies)
Discussion started by: senthilk615
5 Replies

3. Shell Programming and Scripting

finding duplicate files by size and finding pattern matching and its count

Hi, I have a challenging task,in which i have to find the duplicate files by its name and size,then i need to take anyone of the file.Then i need to open the file and find for more than one pattern and count of that pattern. Note:These are the samples of two files,but i can have more... (2 Replies)
Discussion started by: jerome Sukumar
2 Replies

4. Shell Programming and Scripting

How do I Substring ??

Hello everyone. I'm writing a script in UNIX. The purpose is to get the second character from a variable that stores the system year. This is the code: unix_year_yy=`date "+%g"` This will return "07" in variable unix_year_yy. How can I get the second character (7)?? (6 Replies)
Discussion started by: Rigger
6 Replies

5. Shell Programming and Scripting

help for shell script of finding shortest substring from given string by user

please give me proper solution for finding a shortest substring from given string if string itself and first char and last char of that substr are also given by user if S="dpoaoqooroo" and FC="o" and LC="o",then shortest substr is "oo" and rest of the string is "dpoaoqroo" i have code but it is... (1 Reply)
Discussion started by: pankajd
1 Replies

6. Shell Programming and Scripting

Finding longest common substring among filenames

I will be performing a task on several directories, each containing a large number of files (2500+) that follow a regular naming convention: YYYY_MM_DD_XX.foo_bar.A.B.some_different_stuff.EXT What I would like to do is automatically discover the part of the filenames that are common to all... (1 Reply)
Discussion started by: cmcnorgan
1 Replies

7. Shell Programming and Scripting

Finding duplicates from positioned substring across lines

I have million's of records each containing exactly 50 characters and have to check the uniqueness of 4 character substring of 50 character (postion known prior) and report if any duplicates are found. Eg. data... AAAA00000000000000XXXX0000 0000000000... upto50 chars... (2 Replies)
Discussion started by: gapprasath
2 Replies

8. Shell Programming and Scripting

Substring based on delimiter, finding last delimiter

Hi, I have a string like ABC.123.XYZ-A1-B2-P1-C4. I want to delimit the string based on "-" and then get result as only two strings. One with string till last hyphen and other with value after last hyphen... For this case, it would be something like first string as "ABC.123.XYZ-A1-B2-P1" and... (6 Replies)
Discussion started by: gupt_ash
6 Replies

9. UNIX for Dummies Questions & Answers

substring

hi , I have complete path Sample: /pkgs/Incoming/Completed/abc123_xyz.zip /pkgs/Incoming/Completed/12_abcxyz.zip /pkgs/Incoming/Completed/qwabcxyz.zip i just need , so that i can copy these files to different directory, abc123_xyz.zip 12_abcxyz.zip qwabcxyz.zip (5 Replies)
Discussion started by: Naveen_5960
5 Replies

10. UNIX for Beginners Questions & Answers

Finding a word through substring in a file

I have a text file that has some data like: PADHOGOA1 IOP055_VINREG5_1 ( .IO(VINREG5_1), .MONI(), .MON_D(px_IOP055_VINREG5_1_MON_D), .R0T(px_IOP054_VINREG5_0_R0T), .IO1() ); PADV30MA0 IOP056_VOUT3_IN ( .IO(VOUT3_IN), .V30M(px_IOP056_VOUT3_IN_V30M)); PADV30MA0 IOP057_VOUT3_OUT (... (2 Replies)
Discussion started by: utkarshkhanna44
2 Replies
iv_work(3)						    ivykis programmer's manual							iv_work(3)

NAME
IV_WORK_POOL_INIT, iv_work_pool_create, iv_work_pool_put, IV_WORK_ITEM_INIT, iv_work_pool_submit_work - ivykis worker thread management SYNOPSIS
#include <iv_work.h> struct iv_work_pool { int max_threads; void *cookie; void (*thread_start)(void *cookie); void (*thread_stop)(void *cookie); }; struct iv_work_item { void *cookie; void (*work)(void *cookie); void (*completion)(void *cookie); }; void IV_WORK_POOL_INIT(struct iv_work_pool *this); int iv_work_pool_create(struct iv_work_pool *this); int iv_work_pool_put(struct iv_work_pool *this); void IV_WORK_ITEM_INIT(struct iv_work_item *work); int iv_work_pool_submit_work(struct iv_work_pool *this, struct iv_work_item *work); DESCRIPTION
Calling iv_work_pool_create on a struct iv_work_pool object previously initialised by IV_WORK_POOL_INIT creates a pool of worker threads that can be used to offload CPU intensive tasks to, so as to prevent negatively influencing event handling latency in the calling thread, and to enable the use of multiple host CPUs for CPU intensive tasks. iv_work dynamically adjusts the number of threads in the pool to the amount of work there is to do. The ->max_threads member of struct iv_work_pool specifies the maximum number of threads that will be created in this pool. Calling iv_work_pool_submit_work on a struct iv_work_item object previously initialised by IV_WORK_ITEM_INIT submits a work item to a pool. The ->work member of struct iv_work_item specifies the function that will be called in one of the worker threads in the pool specified by ->this, with ->cookie as its sole argument. When the work function has completed, iv_work will call the ->completion callback to indicate this, also with ->cookie as its sole argument, in the thread that iv_work_pool_create was called in for this pool object. As a special case, calling iv_work_pool_submit_work with a NULL work pool pointer will cause the work item to be processed in the local thread, from an iv_task(3) callback. If the ->thread_start function pointer specified in struct iv_work_pool is not NULL, it will be called upon creation of a new worker thread, in the context of the created worker thread, with ->cookie as its sole argument. Calls to ->thread_start are not explicitly seri- alised, which should be kept in mind when manipulating state shared between threads from within that callback function. Similarly, if iv_work decides to terminate a worker thread, for example due to inactivity, ->thread_stop will be called in the context of the terminating thread, with ->cookie as its sole argument. Calls to ->thread_stop are also not explicitly serialised. iv_work_pool_submit_work can only be called from the thread that iv_work_pool_create for this pool object was called in. There is no way to cancel submitted work items. There is no guaranteed order, FIFO or otherwise, between different work items submitted to the same worker thread pool. When the user has no more work items to submit to the pool, its reference to the pool can be dropped by calling iv_work_pool_put. If there are still pending or running work items assigned to this pool when iv_work_pool_put is called, those work items will not be can- celed, but will be allowed to run to completion, and their ->completion callbacks will be called as usual. A similar thing holds for the ->thread_start and ->thread_stop callbacks -- they can also still be called after iv_work_pool_put returns. Even so, the memory corre- sponding to the struct iv_work_pool can immediately be freed or reused by the user upon return of the iv_work_pool_put call. Internally, iv_work uses iv_thread(3) for its thread management. SEE ALSO
ivykis(3), iv_thread(3) ivykis 2010-09-14 iv_work(3)
All times are GMT -4. The time now is 04:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy