12-26-2008
Why do you want to load the entire file into memory ( almost entire except for the first line ). Won't that be enough to store the first line and print the rest as and when its being read?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have written a korn script (code pasted below). It is giving the error while debugging "new.sh: syntax error at line 62: `end of file' unexpected".
I have re-written the whole code in VI and explored all help related to this error on this Unix forum and tried it. Somehow, I could... (7 Replies)
Discussion started by: schandrakar1
7 Replies
2. Shell Programming and Scripting
My input file is multiline file and I am writing a script to search for a pattern and move the line with the pattern and the next line to the end of the file. Since I am trying to learn awk, I thought I would try it.
My input looks like the following:
D #testpoint 1
510.0
D #testpoint2 ... (5 Replies)
Discussion started by: banjo25
5 Replies
3. Shell Programming and Scripting
Can somebody help me with a script ....
Read a file /etc/inittab
find the string starting with rcml and move it entirely towards the end of file.
rcml:2:once:/usr/sni/aix52/rc.ml > /dev/console 2>&1
I basically want to change the startup sequence. (2 Replies)
Discussion started by: imanuk2007
2 Replies
4. Shell Programming and Scripting
I have the following text format in a file which lists the question first and then 5 choices
after that the explanantion and finally the answer.
1.The amount of time it takes for most of a worker’s occupational knowledge and skills to become
obsolete has been declining because of the... (2 Replies)
Discussion started by: nanchil_guy
2 Replies
5. Shell Programming and Scripting
Hi Folks,
I was given a task to append three IP's at the end of a specific (and unique) line within a file on multiple servers.
I was not able to do that with the help of a script. All I could was:
for i in server1 server2 server3 server4
do
ssh $i
done
I know 'sed' could be used to... (5 Replies)
Discussion started by: momin
5 Replies
6. Shell Programming and Scripting
Hey guys,
I want move a specific word from the middle of the text and move it the end of the file, which means I want the word to be deleted from it's line and moved to the end of file.
I know how to use sed for adding a word the end of file, but I don't know how to move words.
tnx (2 Replies)
Discussion started by: Johanni
2 Replies
7. Shell Programming and Scripting
Hello,
I'm new to this forum. I've been doing a lot of sed work lately and have found many useful tips on this forum. I've hit a roadblock in a project, though, and could really use some help.
I have a text file with many lines like the following, i.e., some lines begin with a single word... (3 Replies)
Discussion started by: paroikoi
3 Replies
8. Shell Programming and Scripting
first of all I thought the argument DONE is necessary for all scripts that have or begin with do statements which I have on my script, However, I still don't completely understand why I am receiving an error I tried adding another done argument statement but didn't do any good.
I appreciate... (3 Replies)
Discussion started by: wolf@=NK
3 Replies
9. Shell Programming and Scripting
Hello,
I'm works on Ubuntu server
My goal : I would like to read file line per line, but i want to started at the end of file.
Currently, I use instructions :
while read line;
do
COMMAND
done < /var/log/apache2/access.log
But, the first line, i don't want this. The file is long... (5 Replies)
Discussion started by: Fuziion
5 Replies
10. Shell Programming and Scripting
My file (the output of an experiment) starts off looking like this,
_____________________________________________________________
Subjects incorporated to date: 001
Data file started on machine PKSHS260-05CP
**********************************************************************
Subject 1,... (9 Replies)
Discussion started by: samonl
9 Replies
LEARN ABOUT HPUX
elf_cntl
elf_cntl(3E) elf_cntl(3E)
NAME
elf_cntl - control a file descriptor
SYNOPSIS
[flag... ] file... [library] ...
DESCRIPTION
instructs the library to modify its behavior with respect to an ELF descriptor, elf. As elf_begin(3E) describes, an ELF descriptor can
have multiple activations, and multiple ELF descriptors may share a single file descriptor. Generally, commands apply to all activations
of elf. Moreover, if the ELF descriptor is associated with an archive file, descriptors for members within the archive will also be
affected as described below. Unless stated otherwise, operations on archive members do not affect the descriptor for the containing ar-
chive.
The cmd argument tells what actions to take and may have the following values.
This value tells the library not to use the file
descriptor associated with elf. A program should use this command when it has requested all the information it cares to
use and wishes to avoid the overhead of reading the rest of the file. The memory for all completed operations remains
valid, but later file operations, such as the initial for a section, will fail if the data is not in memory already.
This command is similar to
except it forces the library to read the rest of the file. A program should use this command when it must close the file
descriptor but has not yet read everything it needs from the file. After completes the command, future operations, such
as will use the memory version of the file without needing to use the file descriptor.
If succeeds, it returns zero. Otherwise, elf was null or an error occurred, and the function returns -1.
Note
If the program wishes to use the ``raw'' operations (see described in elf_getdata(3E), and elf_rawfile(3E)) after disabling the file
descriptor with or it must execute the raw operations explicitly beforehand. Otherwise, the raw file operations will fail. Calling makes
the entire image available, thus supporting subsequent calls.
SEE ALSO
elf(3E), elf_begin(3E), elf_getdata(3E), elf_rawfile(3E).
elf_cntl(3E)