Sponsored Content
Top Forums Shell Programming and Scripting reading file,looping and limitation Post 302568905 by felipe.vinturin on Friday 28th of October 2011 02:48:02 PM
Old 10-28-2011
Use a control variable:
Code:
controlVar=1
while read line
do
	if [ ${controlVar} -eq 1 ]
	then
		Func_A "${line}"
	elif [ ${controlVar} -eq 2 ]
	then
		Func_B "${line}"
	elif [ ${controlVar} -eq 3 ]
	then
		Func_C "${line}"
	elif [ ${controlVar} -eq 4 ]
	then
		Func_D "${line}"
		controlVar=1
	fi
	controlVar=`expr ${controlVar} + 1`
done <abc.txt

EDIT: Sorry, after I posted I read the topic carefully!

I could not understand what the OP wants!
 

10 More Discussions You Might Find Interesting

1. Solaris

unix group file limitation

Does anyone know how to get around the unix group file limitation whereby you have a limit of 1024 characters when adding users to a unix group? (3 Replies)
Discussion started by: asmillie
3 Replies

2. HP-UX

HP-UX 11i - File Size Limitation And Number Of Folders Limitation

Hi All, Can anyone please clarify me the following questions: 1. Is there any file size limitation in HP-UX 11i, that I can able to create upto certain size of file (say 2 GB) and not more then that???? 2. At max. how many files we can able to keep inside a folder???? 3. How many... (2 Replies)
Discussion started by: sundeep_mohanty
2 Replies

3. Shell Programming and Scripting

File size limitation of unix sort command.

hi , iam trying to sort millions of records which is delimited and i cant able to use sort command more than 60 million..if i try to do so i got an message stating that "File size limit exceeded",Is there any file size limit for using sort command.. How can i solve this problem. thanks ... (7 Replies)
Discussion started by: cskumar
7 Replies

4. Linux

File size limitation for rcp

Hi I am trying to rcp a file from Solaris box to Linux. When the file size is 2,205,255,047, the rcp fails with the message Jan 10 01:11:53 hqsas167 rsh: pam_authenticate: error Authentication failed However when I rcp a file with smaller size - 9,434,477 - the rcp completes with... (2 Replies)
Discussion started by: schoubal
2 Replies

5. UNIX for Dummies Questions & Answers

Unix -- Space problem -- File number limitation?

Dear all Recently I cant touch file in one mount point (which is not full, 78% full only), it says can't write to device, obviously it means it's full, I deleted some files and I can write some files only. I wonder is there any file number limitation in a mount point and how can I check or how... (2 Replies)
Discussion started by: shanemcmahon
2 Replies

6. Shell Programming and Scripting

fetchmail - log file size limitation

Hi, I am using fetchmail in my application so as to download mails to the localhost where the application is hosted from the mailserver.Fetchmail is configured as as to run as a daemon polling mails during an interval of 1sec. So my concern here is, during each 2sec it is writing two... (10 Replies)
Discussion started by: DILEEP410
10 Replies

7. Solaris

How to extend 2 GB file size limitation

Hello All, I am using a SunOS machine. My application creates output files for the downstream systems. However output files are restricted to 2GB of file size in SunOS due to which I am forced to create multiple files which is not supported by the downstream due to some limitations. Is... (5 Replies)
Discussion started by: pasupuleti81
5 Replies

8. UNIX for Dummies Questions & Answers

Looping/Reading file contents not working

Hi, I am doing something basic, but I am missing something. Im trying to read the contents of a file and taking those values and connecting to a database. However, it only connect to one (or reads in) value and then exists. Here is what it looks like: listname.txt db1 db2 db3 Script:... (15 Replies)
Discussion started by: DBnixUser
15 Replies

9. HP-UX

NFS file transfer limitation

Hello friends, i hace a problem in nfs file transfer i mounted hp-unix directory into linux directory the command i used: mount <IP_Address>:/home/new /usr/new i have already done everything in linux side for exporting. then i tried to copy a file which one size is 18 gb but file... (5 Replies)
Discussion started by: siva3492
5 Replies

10. Linux

File size limitation in Linux

Hi friends, I tried to take a backup of my PC using tar command. But it ended with an error tar: /home/backup/back.tar.gz: Cannot write: No space left on device tar: Error is not recoverable: exiting now But i checked the disk space and there is enough space is available. ]# df Filesystem... (11 Replies)
Discussion started by: siva3492
11 Replies
IO::BufferedSelect(3pm) 				User Contributed Perl Documentation				   IO::BufferedSelect(3pm)

NAME
IO::BufferedSelect - Line-buffered select interface SYNOPSIS
use IO::BufferedSelect; my $bs = new BufferedSelect($fh1, $fh2); while(1) { my @ready = $bs->read_line(); foreach(@ready) { my ($fh, $line) = @$_; my $fh_name = ($fh == $fh1 ? "fh1" : "fh2"); print "$fh_name: $line"; } } DESCRIPTION
The "select" system call (and the "IO::Select" interface) allows us to process multiple streams simultaneously, blocking until one or more of them is ready for reading or writing. Unfortunately, this requires us to use "sysread" and "syswrite" rather than Perl's buffered I/O functions. In the case of reading, there are two issues with combining "select" with "readline": (1) "select" might block but the data we want is already in Perl's input buffer, ready to be slurped in by "readline"; and(2) "select" might indicate that data is available, but "readline" will block because there isn't a full $/-terminated line available. The purpose of this module is to implement a buffered version of the "select" interface that operates on lines, rather than characters. Given a set of filehandles, it will block until a full line is available on one or more of them. Note that this module is currently limited, in that(1) it only does "select" for readability, not writability or exceptions; and(2) it does not support arbitrary line separators ($/): lines must be delimited by newlines. CONSTRUCTOR
new ( HANDLES ) Create a "BufferedSelect" object for a set of filehandles. Note that because this class buffers input from these filehandles internally, you should only use the "BufferedSelect" object for reading from them (you shouldn't read from them directly or pass them to other BufferedSelect instances). METHODS
read_line read_line ($timeout) read_line ($timeout, @handles) Block until a line is available on one of the filehandles. If $timeout is "undef", it blocks indefinitely; otherwise, it returns after at most $timeout seconds. If @handles is specified, then only these filehandles will be considered; otherwise, it will use all filehandles passed to the constructor. Returns a list of pairs "[$fh, $line]", where $fh is a filehandle and $line is the line that was read (including the newline, ala "readline"). If the filehandle reached EOF, then $line will be undef. Note that "reached EOF" is to be interpreted in the buffered sense: if a filehandle is at EOF but there are newline-terminated lines in "BufferedSelect"'s buffer, "read_line" will continue to return lines until the buffer is empty. SEE ALSO
IO::Select AUTHOR
Antal Novak, <afn@cpan.org> COPYRIGHT AND LICENSE
Copyright (C) 2007 by Antal Novak This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available. perl v5.10.1 2007-03-13 IO::BufferedSelect(3pm)
All times are GMT -4. The time now is 03:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy