02-15-2006
Yes, that was not correct - exec doesn't necessarily close file descriptors.
However I still don't understand what the OP is trying to achieve.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
With so many diffrent flavors out there, how is a person soposed to know what to go with? I'm not asking for specific discussion here in this forum, but I would like to see various pages and articles dicsussing the pluses and minuses of various unix/linux OS's. I have been searching various... (1 Reply)
Discussion started by: MorderKartoffel
1 Replies
2. UNIX for Advanced & Expert Users
Hi guys,
We have different IP ranges in our LAN, for instance my system IP Add. is in 163.183.37.x range, in the meantime i wish to connect to our printer/plotter which is 163.183.4.x & our LAN in another location with 163.183.38.x.
What shoul i do except defining pesudo IP Add's? as a... (1 Reply)
Discussion started by: nikk
1 Replies
3. UNIX for Dummies Questions & Answers
Can sed be used to take a existing record and reverse the order of defined character placement if there is no delimeters?
existing record:
0123456789CO
expected result:
9876543210CO
if there were delimeters I could define the delimeter and each placement would have an id which I... (1 Reply)
Discussion started by: r1500
1 Replies
4. Shell Programming and Scripting
When I type a command at the command line it supplies one result and the exact same command in a script
egrep '^01|^02|^03|^04' file > fileout
count = 29353
same count in the script yields a count of 23492
is there any reason this could be happening. (1 Reply)
Discussion started by: r1500
1 Replies
5. Shell Programming and Scripting
i have serverA and serverB and i have a folder with same name an location in both servers.... Now i want to compare files in folder(serverA) with folder (serverB) if there are files missing in folderB then copy those files from folder(serverA) to folder(serverB) (1 Reply)
Discussion started by: ashahzad
1 Replies
6. Red Hat
Hi
im trying to configure samba on linux server so win client can access the shared files but my win client is on diffrent domain , we recently changed our domain name but not for certain servers...
i guess the samba linux server is still part of our sub domain which is why i still can access... (4 Replies)
Discussion started by: halacil
4 Replies
7. Solaris
Hi,
I have issue with cron.
When i run script manually output is fine but when i add it to cron output file is not as same.
both file attach some junk charecter comming in cron output.
thanx
Jignesh (5 Replies)
Discussion started by: jkmistry
5 Replies
8. Shell Programming and Scripting
I couldn't find the answer anywhere, so I hope you could help me.
I need to change something like the following:
something/bla/aaaa
anything/bbb
to:
something
--bla
----aaaa
anything
--bbb
How do I do this?
Is it possible with sed?
I tried various patterns, but don't know how to... (5 Replies)
Discussion started by: Patwan
5 Replies
9. Shell Programming and Scripting
Heyas
I'm currently attempting to apply the code of tui-select to tui-list.
That is because tui-list simply made a 1 string list, while tui-select uses dynamicly up to 3 strings per line.
Anyway, so i copy pasted the code, and just made the changes marked with red....
Know that both scripts... (2 Replies)
Discussion started by: sea
2 Replies
10. UNIX for Beginners Questions & Answers
hi,
would you help me?
i have file total.csv
"a","e23","f"
"b,"34d","g"
"c","45f","f"
"d","45s","f"
count.csv
3
i do this :
paste -d',",' total.csv count.csv
but the result like this:
"a,"e23","f" 3
"b,"34d","g" (1 Reply)
Discussion started by: kivale
1 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)