![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bourne Shell: if elsif question | leostar_10 | Shell Programming and Scripting | 3 | 03-09-2008 07:37 PM |
| IF THEN ELIF question in BOURNE SHELL | arun_st | UNIX for Dummies Questions & Answers | 4 | 04-20-2007 12:41 PM |
| Bourne-again shell | mrsamer | UNIX for Dummies Questions & Answers | 3 | 09-30-2006 02:42 AM |
| cd from a Bourne Shell Script - Please Help | fawqati | Shell Programming and Scripting | 10 | 05-25-2006 03:26 AM |
| Bourne Shell and Arrays | Unbeliever | Shell Programming and Scripting | 2 | 07-25-2005 10:48 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
bourne shell timing question
In one of my scripts I do the following
sort +0 x > y mv y x In my script x and y are fully qualified. This works 99% of the time. However once in a while the system comes back and says that is cannot access y in the mv command. I did some research and I suspect that if I insert a "wait" command inbetween these two lines it will work. Although the wait command is for background processes. Is that what's happening here? Is the sort with a redirect happening in the background? Thanks, Gill OS = Solaris |
|
||||
|
Sabotage? y is actually /xxxx/xxxxxx/xxxxxx/xxxx/nnnnnnnn.xxx.$$ in length. Would someone be able to delete it while the redirection was happening? While quite a few people happen to know this userid/pswd I find this fairly hard to believe. I'll test that scenario though.
|
|
||||
|
I'm very good at producing bugs myself. But this code has run as is for years. The server was moved last weekend but I don't think there were any os changes. By the way, the sabotage line came from a user (ex submariner) that decided his bugs had to be sabotage. But considering that these files contain the processes pid to ensure they don't get overwritten by another instance of the process it would have to be someone jerking my chain if they were getting removed. We have a high priced unix consultant here that told me that sort with the redirection causes a seperate process to occur and the redirection is asyncronous so he thought that the move was happening before the redirection flushed the buffers. He suggested that I could add a sleep 1 or rm x before the move and probably never have the problem again. Gill
|
|
|||||
|
Quote:
Redirection is not asyncronous with other elements of your script. Redirection does not cause any buffers to be flushed. If anything is in the buffer cache and not yet synced to disk, that is irrelevant. All i/o goes though the buffer cache anyway. "rm x" to make y spring back into existence? Whoa.... I don't even know what to say about that. "sleep 1" increases the window between the creation of the file and the time the mv needs it. This is likely to make the problem occur with greater frequency. |
![]() |
| Bookmarks |
| Tags |
| solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|