Sponsored Content
Top Forums Shell Programming and Scripting Verifying sting format in bash Post 83671 by Perderabo on Saturday 17th of September 2005 02:00:44 PM
Old 09-17-2005
Code:
if [[ $something == [a-zA-Z][a-zA-Z][0-9][0-9][0-9][0-9] ]]; then
        echo one file
else
        echo the other file
fi

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

bash date format

hi guys. in bash is there any other way of limiting the time displayed to HH:MM appart from (date +"%H:%M") and (date +"%R")? i want to input time into a database in the form HH:MM have tried NOW() but this gives me HH:MM:SS thanks in advance (1 Reply)
Discussion started by: vadharah
1 Replies

2. Shell Programming and Scripting

Extracting value from a sting using perl

Hi Experts, I want to extract the value of SESSIONID AND USERID from the this string using perl. XML Request },&quot;USER_PREF&quot;:{&quot;sys_lang&quot;:&quot;en-us&quot;,&quot;timezone&quot;:&quot;480&quot;,&quot;user_lang&quot;:&quot;en-us&quot;}}}</DEVICESIG></POLICYREQ>] The answer should be SessionID=1:3133050 and USERID=01451651 Please advise how... (3 Replies)
Discussion started by: namishtiwari
3 Replies

3. Shell Programming and Scripting

Assign a sting to a name?

i want to assign a anme for a string, i got the things below, but it doesn't work. MParc1=`` if then $MPrac1=`Prac1` # assign $MPrac1 to Prac1 else $MPrac1=`` #assigne $MPrac1 to nothing fi echo "${MPrac1} >>file Output: (if num is 0) Prac1 can you please... (6 Replies)
Discussion started by: mingming88
6 Replies

4. Programming

Java sting up path problem

Hi java programmers I'm a newbee to the Java. Could please help me to set the path correctly. I'm getting the following error. ----jGRASP exec: javac -g C:\Documents and Settings\bogugk\Desktop\HelloWorldApp.java ----jGRASP wedge2 error: command "javac" not found. ---- This command... (1 Reply)
Discussion started by: repinementer
1 Replies

5. Shell Programming and Scripting

How to grep sting (*) ?

Hi all, I am trying to grep something from log file. For example. i need to grep sting = "*834*1" My LOG 2010-05-05 09:27:57,649|3|ABCD834|192.168.38.72|2365|444850623031|0|8|-|0|*834*1*1499413*00853662524#|470540.7219101273026475158 2010-05-05... (3 Replies)
Discussion started by: ooilinlove
3 Replies

6. Shell Programming and Scripting

how to format a number in bash

Say I have a number x=123, but I want to it be x=000123, because I need to use it in as a file name. thanks! (2 Replies)
Discussion started by: aerosols
2 Replies

7. Shell Programming and Scripting

Inserting a string in another sting

Hi Experts, I need to insert a sting into another string at a specified position. Like the below. Regards, Tin-Tin (3 Replies)
Discussion started by: tinufarid
3 Replies

8. Shell Programming and Scripting

Replace sting in a file

Hi Gurus, I need to search and replace string <! in a file with a blank. Some how my command sed -i 's/\<\!\ is not working .. Kindly help (1 Reply)
Discussion started by: r_t_1601
1 Replies

9. Shell Programming and Scripting

Find and replace a string in group of sting

Hi, 1. I want to remove the line which contains "SUBPARTITION", but the condition is if line has ends with ")," replace with , else delete the line I was trying with the sed command i... (3 Replies)
Discussion started by: gavemani
3 Replies

10. Shell Programming and Scripting

Awk to search for sting in lines and then email.

I'm trying to use awk in a script to search for a string number in a plist file. basically its a plist that records the bandwidth usage, and if the number is greater than 3GB which is equals 3221225472 bytes, it will send me an alert by email. here is the file: =<?xml version="1.0"... (4 Replies)
Discussion started by: ivaldiz
4 Replies
mlib_ImageBlendColor(3MLIB)				    mediaLib Library Functions				       mlib_ImageBlendColor(3MLIB)

NAME
mlib_ImageBlendColor - blend an image and a color SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_ImageBlendColor(mlib_image *dst, const mlib_image *src, const mlib_s32 *color, mlib_s32 cmask); DESCRIPTION
The mlib_ImageBlendColor() function blends an image and a color with the alpha channel. It uses the following equation: Cd = Cs*As + Cc*(1 - As) Ad = 1.0 where, Cs and Cd are the RGB color components of the source and destination images, respectively. As and Ad are the alpha components of the source and destination images, respectively. Cc is the color component of the constant color. For MLIB_BYTE images, the alpha coefficients are in Q8 format. For MLIB_SHORT images, the alpha coefficients are in Q15 format and must be positive. For MLIB_USHORT images, the alpha coefficients are in Q16 format. For MLIB_INT images, the alpha coefficients are in Q31 format and must be positive. The images can have two to four channels. The length of color array must not be less than the number of channels in the images. PARAMETERS
The function takes the following arguments: dst Pointer to destination image. src Pointer to source image. color Array of constant color components. cmask Channel mask to indicate the alpha channel. Each bit of cmask represents a channel in the image. The channel corresponding to the highest bit with value 1 is the alpha channel. 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_ImageBlendColor_Inp(3MLIB), mlib_ImageBlendColor_Fp(3MLIB), mlib_ImageBlendColor_Fp_Inp(3MLIB), attributes(5) SunOS 5.10 10 Nov 2004 mlib_ImageBlendColor(3MLIB)
All times are GMT -4. The time now is 12:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy