06-23-2009
In order to accept your post I will now close the previous...
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I need to read a text file from shell script line by line and copy the feilds of each line.
Below is the complete requirement.
I've text file which contains ...
pgm1 file11 file12 file13
pgm2 file21 file22
pgm3 file31 file32 file33
I'll give input as... (4 Replies)
Discussion started by: ani12345
4 Replies
2. Shell Programming and Scripting
I have an issue where I need to append a value at the last of the csv, I have created a shell script and it is appending the columns at the last but it is appending at all lines, and my requirement is specific to just append at the 1st line.
Have a look and suggest, (7 Replies)
Discussion started by: anujrichhariya
7 Replies
3. Shell Programming and Scripting
hello ,
plz help for below script req:-
how can we read a file line by line in shell script ? (4 Replies)
Discussion started by: abhigrkist
4 Replies
4. 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
5. Shell Programming and Scripting
Hi ,
I am trying to write an shell, which reads a text file (from a location) having a list of numbers of strictly 5 digits only ex: 33144
Now my script will check :
1) that each entry is only 5 digits & numeric only, no alphabets, & its not empty.
2)then it executes a shell script called... (8 Replies)
Discussion started by: new_to_shell
8 Replies
6. Shell Programming and Scripting
Hi all
I have spent half a day trying to create a shell script which reads a configuration file on a line by line basis.
The idea of the file is that each will contain server information, such as IP address and various port numbers. The line could also be blank (The file is user created). Here... (1 Reply)
Discussion started by: haggismn
1 Replies
7. Shell Programming and Scripting
I have a LOG file which looks like this
Import started at: Mon Jul 23 02:13:01 EDT 2012
Initialization completed in 2.146 seconds.
--------------------------------------------------------------------------------
--
Import summary for Import item: PolicyInformation... (8 Replies)
Discussion started by: biztank
8 Replies
8. Shell Programming and Scripting
Hi All,
We have a file in the following format:
0.010000 $ ITI 11 LV2 $ 40456211 $
0.135000 $ ITI 11 LV1 $ 40512211 $
1.215600 $ ITI 11 ITI3 $ 41406211 $
24/05/2014 14:05:02
0.030000 $ ITI 11 LV2 $ 40456211 $
... (3 Replies)
Discussion started by: gauravsinghal79
3 Replies
9. Shell Programming and Scripting
Hi,
I had generated a report in my tool as followsoutput.txt
43.35
9
i needed the script to generate a new file like below
i want to append the text to each of these lines of my filenewoutputfile.txt should be
Total Amount : 43.35
Record Count:9
Regards,
Vasa Saikumar.
... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies
10. Shell Programming and Scripting
i have a text file as belows, it includes 2 columns, 1st is the column name, 2nd is the file_name
data_file.txt
column_name file_name
col1 file1
col2 file2
col3 file1
col4 file1
col5 file2
now, i would like to... (4 Replies)
Discussion started by: tester111
4 Replies
CLOSE(2) System Calls Manual CLOSE(2)
NAME
close - delete a descriptor
SYNOPSIS
close(d)
int d;
DESCRIPTION
The close call deletes a descriptor from the per-process object reference table. If this is the last reference to the underlying object,
then it will be deactivated. For example, on the last close of a file the current seek pointer associated with the file is lost; on the
last close of a socket(2) associated naming information and queued data are discarded; on the last close of a file holding an advisory lock
the lock is released (see further flock(2)).
A close of all of a process's descriptors is automatic on exit, but since there is a limit on the number of active descriptors per process,
close is necessary for programs that deal with many descriptors.
When a process forks (see fork(2)), all descriptors for the new child process reference the same objects as they did in the parent before
the fork. If a new process is then to be run using execve(2), the process would normally inherit these descriptors. Most of the descrip-
tors can be rearranged with dup2(2) or deleted with close before the execve is attempted, but if some of these descriptors will still be
needed if the execve fails, it is necessary to arrange for them to be closed if the execve succeeds. For this reason, the call ``fcntl(d,
F_SETFD, 1)'' is provided, which arranges that a descriptor will be closed after a successful execve; the call ``fcntl(d, F_SETFD, 0)''
restores the default, which is to not close the descriptor.
RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and the global integer variable errno is set to
indicate the error.
ERRORS
Close will fail if:
[EBADF] D is not an active descriptor.
SEE ALSO
accept(2), flock(2), open(2), pipe(2), socket(2), socketpair(2), execve(2), fcntl(2)
4th Berkeley Distribution May 22, 1986 CLOSE(2)