Sponsored Content
Top Forums Shell Programming and Scripting Modifying the shell script to select pattern Post 302934781 by Chubler_XL on Tuesday 10th of February 2015 03:02:48 PM
Old 02-10-2015
My guess for the splitting requirement is lines are to be split with "\" if they exceed 170 characters.

This could be achieved with:

Code:
srmls "$PATHNAME" | sed -En -e 's:^(/[^\/]+){4}::' -e "/$GREP/"'s/.{170}/&\\\n/gp'


Last edited by Chubler_XL; 02-10-2015 at 04:13 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Modifying a csv file from Shell Script

Hi all, I have some script that creates a temp csv file. What I need to do is do some search and replace and modify the file from my shell script. I know the commands to open the file and then apply the reg ex but wasnt sure how I could do this from a script and modify the file? Any help... (2 Replies)
Discussion started by: not4google
2 Replies

2. Shell Programming and Scripting

using SELECT sql statement in shell script

Hi there I have a database on a remote box and i have been using shell script to insert data into it for example, i could have a script that did this SN=123456 n=server1 m=x4140 sql="UPDATE main SET hostname='$n',model='$m' WHERE serial='$SN';" echo $sql |/usr/sfw/bin/mysql -h... (4 Replies)
Discussion started by: hcclnoodles
4 Replies

3. UNIX for Dummies Questions & Answers

Modifying a shell script without using an editor

Hi all, I really wan't to know that how to edit a shell script with out using an editor.. Is there any command? (4 Replies)
Discussion started by: buddhi
4 Replies

4. Shell Programming and Scripting

How to use select into command in shell script?

I need to get total number of rows in a table by using select count(*) from table and need to assign into a variable in shell script. I used the following script, it does return the number of rows but also with oracle headers, Please help me to eliminate this headers. Shell Script #!/bin/sh... (16 Replies)
Discussion started by: vel4ever
16 Replies

5. Shell Programming and Scripting

Select combination unique using shell script

Hi All, bash-3.00$ gzgrep -i '\ ExecuteThread:' /******/******/******/******/stdout.log.txt.gz <Jan 7, 2012 5:54:55 PM UTC> <Error> <WebLogicServer> <BEA-000337> < ExecuteThread: '414' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "696" seconds working on the request... (4 Replies)
Discussion started by: osmanux
4 Replies

6. Shell Programming and Scripting

Execution problem with shell script for modifying a user

#/bin/sh echo "enter the user name" read $username echo "Enter new home directory" read $newhd usermod -d $newhd $username ;; error while executing : enter the user name Rev Enter new home directory: /home/58745 usermod: option requires an argument -- 'd' Try `usermod --help' or... (2 Replies)
Discussion started by: Revanth547
2 Replies

7. Shell Programming and Scripting

Modifying contents of the file in shell script

Hello all, I have a Kconfig file that looks like something below ... ================================ menu "Application type" config GUI_TYPE_STANDARD bool "Standard Application" source "cfg/config/std.in" source... (12 Replies)
Discussion started by: anand.shah
12 Replies

8. Shell Programming and Scripting

How to print the output of a select query using shell script?

HI, I want to connect to database and fetch the count from a table. The sql query is as below : select count(*) from table_test where test_column='read'; How can I print the output of this statement using shell script. Thanks in advance. (4 Replies)
Discussion started by: confused_info
4 Replies

9. Shell Programming and Scripting

Modifying/Adding in the DNS server entry using shell script

Dear Experts. I need to add/modify the entries in the DNS server and this has to be achieved using shell script and below is the requirement, could you please let me know if a shell script can be written for this task? 1. Log in to primary DNS server 2. Check /etc/named.conf if zone is... (4 Replies)
Discussion started by: VKIRUPHAKARAN
4 Replies

10. Linux

How to execute a simple select script using a shell script?

Hi team, I have two select statements and need to run them using SYSDBA user select * from temp_temp_seg_usage; select segment_name, tablespace_name, bytes/ (1024*1024) UsedMb from dba_segments where segment_name='TEMP_TEMP_SEG_USAGE'; Need to run this using a shell script say named... (1 Reply)
Discussion started by: pamsy78
1 Replies
mlib_ImageColorDitherInit(3MLIB)			    mediaLib Library Functions				  mlib_ImageColorDitherInit(3MLIB)

NAME
mlib_ImageColorDitherInit - initialization for image dithering SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_ImageColorDitherInit(void **colormap, const mlib_s32 *dimensions, mlib_type intype, mlib_type outtype, mlib_s32 channels, mlib_s32 entries, mlib_s32 offset, void **lut); DESCRIPTION
The mlib_ImageColorDitherInit() function creates an internal data structure, colormap, which can be used by one of the following functions for image dithering: mlib_ImageColorErrorDiffusion3x3 mlib_ImageColorErrorDiffusionMxN mlib_ImageColorOrderedDither8x8 mlib_ImageColorOrderedDitherMxN The lut might have either 1 or 3 channels. The type of the lut can be one of the following: MLIB_BYTE in, MLIB_BYTE out (i.e., BYTE-to-BYTE) MLIB_BIT in, MLIB_BYTE out (i.e., BIT-to-BYTE) If dimensions == NULL, then no colorcube will be created. In this case, the user-provided lookup table, lut, will be used for dithering. If dimensions != NULL, then a colorcube is created from scratch in a way shown in the following example. To dither an RGB image of type MLIB_BYTE to a color-indexed image of type MLIB_BYTE, we can use the following parameters: mlib_s32 dimensions[] = {2, 3, 4}; mlib_type intype = MLIB_BYTE; mlib_type outtype = MLIB_BYTE; mlib_s32 channels = 3; mlib_s32 offset = 6; These values would lead to the creation of a colorcube that would dither red values in the source image to one of 2 red levels, green val- ues to one of 3 green levels, and blue values to one of 4 blue levels. You could picture this colorcube as a cube with dimensions of 2, 3, and 4. The index values assigned to the elements in that cube can be described by the following lookup table: Indexes Red Values Green Values Blue Values 0 ... 5 6 0 0 0 7 255 0 0 8 0 128 0 9 255 128 0 10 0 255 0 11 255 255 0 12 0 0 85 13 255 0 85 14 0 128 85 15 255 128 85 16 0 255 85 17 255 255 85 18 0 0 170 19 255 0 170 20 0 128 170 21 255 128 170 22 0 255 170 23 255 255 170 24 0 0 255 25 255 0 255 26 0 128 255 27 255 128 255 28 0 255 255 29 255 255 255 ... The distance between level changes in each channel of the lookup table is determined by the following formulas: multipliers[0] = signof(dimensions[0])*1; multipliers[i] = signof(dimensions[i])* abs(multipliers[i-1]*dimension[i-1]); A negative dimensions[i], so as to a negative multipliers[i], indicates that the values in a color ramp for channel i should appear in decreasing as opposed to increasing order. For each channel i, the values of the levels are determined by the following formulas: double delta = (dataMax - dataMin)/(abs(dimensions[i]) - 1); int levels[j] = (int)(j*delta + 0.5); where dataMax and dataMin are the maximum and minimum values, respectively, for data type intype. Whenever a colorcube is created, if lut != NULL, the lookup table will be filled according to the colorcube and supplied parameters like offset. For the example shown above, the lookup table will start from line 6. In this case, it is the user's responsibility to allocate memory for the lookup table. PARAMETERS
The function takes the following arguments: colormap Internal data structure for image dithering. dimensions Dimensions of the colorcube in the colormap structure. intype Data type of the source image and the lookup table. outtype Data type of the destination indexed image. channels Number of channels of the lookup table and source image. entries Number of entries of the lookup table. offset Index offset of the lookup table. lut Lookup table. RETURN VALUES
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_ImageColorDitherFree(3MLIB), mlib_ImageColorErrorDiffusion3x3(3MLIB), mlib_ImageColorErrorDiffusionMxN(3MLIB), mlib_ImageColorOrdered- Dither8x8(3MLIB), mlib_ImageColorOrderedDitherMxN(3MLIB), attributes(5) SunOS 5.10 10 Nov 2004 mlib_ImageColorDitherInit(3MLIB)
All times are GMT -4. The time now is 09:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy