10-21-2008
Limits of FOR loop to go to end of File
Hi ALL
,
I have a file for e.g.
ajdflkj|dkj|djfj|go|123|4||||||||||||||89|101|||||||||||||||
The length of file is not fixed. So wat the limits should be given in for loop to access till end of file????
Thanks in advance.....
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
%ulimit -a
nofiles(descriptors) 1024
This means that I can open up to 1024 file per process? But wonder if there is any hardlimit imposed by Solaris 2.6 (eg 255) ?
By the way, is there any tool that can trace which files (or sockets) are opened by a process?
Thanks
DY (5 Replies)
Discussion started by: deaniyoer
5 Replies
2. UNIX for Dummies Questions & Answers
What is the kernel parameter ( or other) that sets the maximum number of open files by the o/s (3 Replies)
Discussion started by: blp001
3 Replies
3. UNIX for Advanced & Expert Users
Hi,
I want to search particular pattern and splitting the file in to multiple files. (Splitted files may be more than 150). It got splitted upto 20 files after that, I got some error.
nawk: filename.21 makes too many open files.
input record number 654, file xxxxxxx
Can u guide me to... (1 Reply)
Discussion started by: sharif
1 Replies
4. Shell Programming and Scripting
I have a file called test.dat which contains
a b
I have written a shell script called test.sh
for i in `cat test.dat`
do
echo $i
done
When i run this script using
sh test.sh
I get this message -
test.sh: syntax error at line 6: `end of file' unexpected
What is the... (3 Replies)
Discussion started by: debojyoty
3 Replies
5. Shell Programming and Scripting
Hi all,
I've got 2 files.
File 1 has a list say
a
b
c
d
e
f
File 2 got
start=
What I want is to create File 3 which look like this
start=a,b,c,d,e,f
So is it possible to loop throught File1 to echo it into File3 in one line? (3 Replies)
Discussion started by: stinkefisch
3 Replies
6. UNIX Desktop Questions & Answers
I want to increase the file size, I am trying to store the output but it's not storing the whole output in to the file (7 Replies)
Discussion started by: navintsm
7 Replies
7. Shell Programming and Scripting
(sh shell) I have a function I am using that does a date calculation so I can subtract dates.
get_JD () {
bc << MSG
scale=0
date calculation ……….......
MSG
}
Then I have this little script that runs after it.
read XXX < TESTFILE
pastdate=`get_JD $XXX`
currdate=`get_JD &YYY`... (2 Replies)
Discussion started by: nickg
2 Replies
8. HP-UX
Hi, I'm running HP-UX 10.20. Is there a 2GB file size limit? if so, can i change it? (3 Replies)
Discussion started by: gabriel.560
3 Replies
9. Shell Programming and Scripting
Hello All,
I have file a.txt
I want to add a counter loop at the end of each line in a file
ill explain:
i have a site h**p://test.test=Elite#1
i want to add a a counter to the number at the end of the file, that it will be like this
urlLink//test.test=Elite#1
urlLink//test.test=Elite#2... (3 Replies)
Discussion started by: nexsus
3 Replies
10. UNIX for Dummies Questions & Answers
OS version : RHEL 6.5
Below is an excerpt from /etc/security/limits.conf file for OS User named appusr in our server
appusr soft nproc 2047
appusr hard nproc 16384
What will happen if appusr has already spawned 2047 processes and wants to spawn 2048th process ?
I just want to know... (3 Replies)
Discussion started by: kraljic
3 Replies
break(1) User Commands break(1)
NAME
break, continue - shell built-in functions to escape from or advance within a controlling while, for, foreach, or until loop
SYNOPSIS
sh
break [n]
continue [n]
csh
break
continue
ksh
*break [n]
*continue [n]
DESCRIPTION
sh
The break utility exits from the enclosing for or while loop, if any. If n is specified, break n levels.
The continue utility resumes the next iteration of the enclosing for or while loop. If n is specified, resume at the n-th enclosing loop.
csh
The break utility resumes execution after the end of the nearest enclosing foreach or while loop. The remaining commands on the current
line are executed. This allows multilevel breaks to be written as a list of break commands, all on one line.
The continue utility continues execution of the next iteration of the nearest enclosing while or foreach loop.
ksh
The break utility exits from the enclosed for, while, until, or select loop, if any. If n is specified, then break n levels. If n is
greater than the number of enclosing loops, the outermost enclosing loop shall be exited.
The continue utility resumes the next iteration of the enclosed for, while, until, or select loop. If n is specified then resume at the n-
th enclosed loop. If n is greater than the number of enclosing loops, the outermost enclosing loop shall be used.
On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways:
1. Variable assignment lists preceding the command remain in effect when the command completes.
2. I/O redirections are processed after variable assignments.
3. Errors cause a script that contains them to abort.
4. Words that follow a command preceded by ** that are in the format of a variable assignment are expanded with the same rules as a vari-
able assignment. This means that tilde substitution is performed after the = sign, and also that word splitting and file name genera-
tion are not performed.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
csh(1), exit(1), ksh(1), sh( 1), attributes(5)
SunOS 5.10 17 Jul 2002 break(1)