Sponsored Content
Full Discussion: condition inside a for loop
Top Forums Shell Programming and Scripting condition inside a for loop Post 302240118 by ghostdog74 on Thursday 25th of September 2008 04:35:00 AM
Old 09-25-2008
Code:
head -50 file | while read file_path
do
 .......
done

 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. Shell Programming and Scripting

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... (4 Replies)
Discussion started by: PrasannaKS
4 Replies

4. Shell Programming and Scripting

Using variables created sequentially in a loop while still inside of the loop [bash]

I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends. As an example I've written a script called question (The fist command is to show what is the contents of the... (2 Replies)
Discussion started by: DeCoTwc
2 Replies

5. 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

6. 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

7. Shell Programming and Scripting

BASH loop inside a loop question

Hi all Sorry for the basic question, but i am writing a shell script to get around a slightly flaky binary that ships with one of our servers. This particular utility randomly generates the correct information and could work first time or may work on the 12th or 100th attempt etc !.... (4 Replies)
Discussion started by: rethink
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

If else condition inside for loop of awk command in UNIX shell scripting

Hi , Please excuse me for opening a new thread i am unable to find out the syntax error in my if else condition inside for loop in awk command , my actual aim is to print formatted html td tag when if condition (True) having string as "failed", could anyone please advise what is the right... (2 Replies)
Discussion started by: karthikram
2 Replies
COMEDI_APPLY_CALIBRA(3) 					 Comedi reference					   COMEDI_APPLY_CALIBRA(3)

NAME
comedi_apply_calibration - set hardware calibration from file SYNOPSIS
#include <comedilib.h> int comedi_apply_calibration(comedi_t * device, unsigned int subdevice, unsigned int channel, unsigned int range, unsigned int aref, const char * file_path); STATUS
alpha DESCRIPTION
The function comedi_apply_calibration sets the hardware calibration for the subdevice specified by device and subdevice so that it is in proper calibration when using the channel specified by channel, range index specified by range and analog reference specified by aref. It does so by performing writes to the appropriate channels of the board's calibration subdevice(s). Depending on the hardware, the calibration settings used may or may not depend on the channel, range, or analog reference. Furthermore, the calibrations appropriate for different channel, range, and analog reference parameters may not be able to be applied simultaneously. For example, some boards cannot have their analog inputs calibrated for more than one input range simultaneously. Applying a calibration for range 1 may blow away a previously applied calibration for range 0. Or, applying a calibration for analog input channel 0 may cause the same calibration to be applied to all the other analog input channels as well. Your only guarantee is that calls to comedi_apply_calibration on different subdevices will not interfere with each other. In practice, their are some rules of thumb on how calibrations behave. No calibrations depend on the analog reference. A multiplexed analog input will have calibration settings that do not depend on the channel, and applying a setting for one channel will affect all channels equally. Analog outputs, and analog inputs with independent a/d converters for each input channel, will have calibration settings which do depend on the channel, and the settings for each channel will be independent of the other channels. If you wish to investigate exactly what comedi_apply_calibration is doing, you can perform reads on your board's calibration subdevice to see which calibration channels it is changing. You can also try to decipher the calibration file directly (it's a text file). The file_path parameter can be used to specify the file which contains the calibration information. If file_path is NULL, then Comedilib will use a default file location. The calibration information used by this function is generated by the comedi_calibrate program (see its man page). The functions comedi_parse_calibration_file, comedi_apply_parsed_calibration, and comedi_cleanup_calibration_file provide the same functionality at a slightly lower level. RETURN VALUE
Returns 0 on success, -1 on failure. AUTHORS
David Schleef <ds@schleef.org> Author. Frank Mori Hess <fmhess@users.sourceforge.net> Author. Herman Bruyninckx <Herman.Bruyninckx@mech.kuleuven.ac.be> Author. Bernd Porr <tech@linux-usb-daq.co.uk> Author. Ian Abbott <abbotti@mev.co.uk> Author. COPYRIGHT
Copyright (C) 1998-2003 David Schleef Copyright (C) 2001-2003, 2005, 2008 Frank Mori Hess Copyright (C) 2002-2003 Herman Bruyninckx Copyright (C) 2012 Bernd Porr Copyright (C) 2012 Ian Abbott This document is part of Comedilib. In the context of this document, the term "source code" as defined by the license is interpreted as the XML source. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, version 2.1 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. Comedi 07/06/2012 COMEDI_APPLY_CALIBRA(3)
All times are GMT -4. The time now is 09:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy