Sponsored Content
Full Discussion: If condition inside while???
Top Forums Shell Programming and Scripting If condition inside while??? Post 302310430 by PrasannaKS on Friday 24th of April 2009 06:40:38 PM
Old 04-24-2009
If condition inside while???

Hi

source is text file named alpha.text containing entries

ABC
DEF
XYZ
YYY
BBB


I need a small shell script which should do read the entries in alpha.text one by one and check it with the current date. If the date is Mon (monday) and entry read from the file is 'DEF' then this should be ignored and the script should read the next line XYZ....YYY etc. The output i need is

echo "ABC is present on Sun"
echo "XYZ is present on Mon"

Thanks

PKS
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to check for a condition inside a file

Hi I am writing a script file which sends the log files along with their size in a folder named log to a file called temp.log using the following cmd: ls -st 190_GSTV_HUX_003QISCGSK026** >> /home/user/temp.log the temp.log looks like this: 16 190_GSTV_HUX_003QISCGSK026_message070321.log ... (11 Replies)
Discussion started by: kiran1112
11 Replies

2. Shell Programming and Scripting

Checking condition inside the loop

Hi all, I have one clarification i am using the loop which will process for each record .suppose there is f ailure in the first record it need to send mail and process the next .my code: defcount=`cat <filename>|wc -l` while ] do if <some condiotion> then echo "mail" fi done so... (1 Reply)
Discussion started by: ithirak17
1 Replies

3. Shell Programming and Scripting

condition inside a for loop

I have a for loop in my script as shown below. for file_path in $file_list ; do ........my code .......... ...... done Can i restrict the number of files parsing to the variable file_path as 50? That is, even if I have some 100 files in file_list, I need to take only 50 files for... (7 Replies)
Discussion started by: Vijay06
7 Replies

4. Shell Programming and Scripting

Extract value inside <text> tag for a particular condition.

Hi All! I have obtained following output from a tool "pdftohtml" :: So, my input is as under: <text top="246" left="160" width="84" height="16" font="3">Business purpose</text> <text top="260" left="506" width="220" height="16" font="3">giving the right information and new insights... (3 Replies)
Discussion started by: parshant_bvcoe
3 Replies

5. Shell Programming and Scripting

using flag inside a for loop to check condition

I have a logic like this It initializes the flag variable as "T" at the beginning of the loop everytime Inside each loop it checks for two conditions and updates the flag variable as "A" or "B" In the end of the loop it checks for the value of the variable flag for "A" or "B" and execute... (4 Replies)
Discussion started by: codeman007
4 Replies

6. Shell Programming and Scripting

FTP Command inside If condition

Hi All, I am facing a alien problem in unix shell script. i have a requirement where i have to check first whether a particular file has been created or not if that file has been created then that file needs to be ftped to a particular dir. My Code is like that Success='code for file... (3 Replies)
Discussion started by: aryan_styles
3 Replies

7. Shell Programming and Scripting

grep inside if condition - need help

hi i need help with below code. if ] then log "Exiting the script as ID= NULL" log "Please run script first." fi i am calling grep inside this but its not running any ideas why ?? input file is like this -- Msg 102, Level 20, State 1: Server... (4 Replies)
Discussion started by: dazdseg
4 Replies

8. Shell Programming and Scripting

Check condition inside the loop

Hi, I am in trouble. I can get inside my condition test inside a loop : I am in ksh (solaris) while read file do <commande to retrieve file> >> ${LOG_RETRIEVE_FILE.log} msg_err=$(cat ${LOG_RETRIEVE_FILE.log} | grep "error retrieve") if ; then <sendmail> exit 1 fi done I tried... (6 Replies)
Discussion started by: Aswex
6 Replies

9. Shell Programming and Scripting

matching patterns inside a condition in awk

I have the following in an awk script. I want to do them on condition that: fext == "xt" FNR == NR { />/ && idx = ++i $2 || val = $1 next } FNR in idx { v = val] } { !/>/ && srdist = abs($1 - v) } />/ || NF == 2 && srdist < dsrmx {... (1 Reply)
Discussion started by: kristinu
1 Replies

10. Shell Programming and Scripting

Modifying awk code to be inside condition

I have the following awk script and I want to change it to be inside a condition for the file extension. ################################################################################ # abs: Returns the absolute value of a number function abs(val) { return val > 0 ? val \ ... (4 Replies)
Discussion started by: kristinu
4 Replies
mlib_ImageBlend2_Fp_Inp(3MLIB)				    mediaLib Library Functions				    mlib_ImageBlend2_Fp_Inp(3MLIB)

NAME
mlib_ImageBlend2_Fp_Inp - blend with an alpha image SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_ImageBlend2_Fp_Inp(mlib_image *src2dst, const mlib_image *src1, const mlib_image *alpha); DESCRIPTION
The mlib_ImageBlend2_Fp_Inp() function blends two images together, in place, on a pixel-by-pixel basis using an alpha image, when a is also on a pixel basis. The alpha image can be a single-channel image or have the same number of channels as the source and destination images. It uses the following equation when the alpha image is a single-channel image: src2dst[x][y][i] = alpha[x][y][0]*src1[x][y][i] + (1 - alpha[x][y][0])*src2dst[x][y][i] It uses the following equation when the alpha image has the same number of channels as the source and destination images: src2dst[x][y][i] = alpha[x][y][i]*src1[x][y][i] + (1 - alpha[x][y][i])*src2dst[x][y][i] It uses the following equation: PARAMETERS
The function takes the following arguments: src2dst Pointer to second source and destination image. src1 Pointer to first source image. alpha Alpha image used to control blending. The pixels in this image should have values in the range of [0.0, 1.0]. 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 |Committed | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_ImageBlend(3MLIB), mlib_ImageBlend_Fp(3MLIB), mlib_ImageBlend1_Fp_Inp(3MLIB), mlib_ImageBlend1_Inp(3MLIB), mlib_Image- Blend2_Inp(3MLIB), attributes(5) SunOS 5.11 2 Mar 2007 mlib_ImageBlend2_Fp_Inp(3MLIB)
All times are GMT -4. The time now is 02:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy