consistency in unix files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting consistency in unix files
# 1  
Old 05-07-2009
consistency in unix files

hi all,
problem 1.) i want to change the content of the file and save with the same name i get the solution like do a sed on that file and mv to same location. IS there any alternative solution of this???

problem 2) in this senario multiple scripts using a single file each script changes the content of the file will this work i mean whn one script chnaging the content and another script also comes into picture will second script wait for first script to relase the file whether second script wait or fail???????

and if problem 1 is doing its action like SED and MOV what heppen when second script comes in to action same time
# 2  
Old 05-07-2009
Most scripts do not/cannot lock a file (depending on the OS). Your scripts will fail.
I cannot predict what will happen, but chances are you won't like it.

You best bet is to create a "traffic cop file" - a lock file. If every script abides nicely by the directions provided by the lock file then everything will be fine. Each script has to read and then update the lock file when it starts and when it ends. It has to do that even if it ends with an error or some kind trappable signal - you have to have trap statements.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

UNIX command to copy files from Windows to UNIX box

Hi Folks, I have a file name abc.xml in my windows machine at the location c:\ytr\abc.xml which I want to place at the unix box machine inside cde directory.. at the following location that is /opt/app/cde/ now the credentials of unix box are abc345 -->(dummyid) ftyiu88--->(dummy passwd) ... (4 Replies)
Discussion started by: punpun66
4 Replies

2. Shell Programming and Scripting

How to create zip/gz/tar files for if the files are older than particular days in UNIX or Linux?

I need a script file for backup (zip or tar or gz) of old log files in our unix server (causing the space problem). Could you please help me to create the zip or gz files for each log files in current directory and sub-directories also? I found one command which is to create gz file for the... (4 Replies)
Discussion started by: Mallikgm
4 Replies

3. UNIX for Dummies Questions & Answers

write a program in c in unix that display the files(includ sub-direc and files within) in a sorted

the sorting is based on name of file, file size modification time stamps o f file it should dislay the output in the following format "." and ".." enteries should be ignored please give some idea how to do it (1 Reply)
Discussion started by: pappu kumar jha
1 Replies

4. Shell Programming and Scripting

How to extract data from indexed files (ISAM files) maintained in an unix server.

Hi, Could someone please assist on a quick way of How to extract data from indexed files (ISAM files) maintained in an UNIX(AIX) server.The file data needs to be extracted in flat text file or CSV or excel format . Usually we have programs in microfocus COBOL to extract data, but would like... (2 Replies)
Discussion started by: devina
2 Replies

5. HP-UX

Copying files from one unix to another unix box

Need a clarification .... While copying files from one unix to another unix box . I am working on two / three unix boxes which are all in a network.. in which home directory are mounted ..(I didn't understand what is the exact meaniing of that) So can i copy the files from one box to another... (2 Replies)
Discussion started by: girija
2 Replies

6. HP-UX

to get the timestamp of files from the files and folders in Unix

Hi, I had a directory and many subdirectories and files with in it. Now i want to get the timestamp of files from the files and folders recursively. :( Please help me to generate a script fort he above mentioned requirement! Appreciate for ur qick response Thanks in advance! ... (2 Replies)
Discussion started by: kishan
2 Replies

7. Filesystems, Disks and Memory

Unix Sco Open Server, Windows Computers Problem Access Unix Shared Files Help!!!!!

Hello Moto I hope someone can help We's here at work, have a unix box with sco openserver 5 on it, so it has a nice gui interface.. and also a fair few windows computers.. a system admin guy b4 me, has set up a user called neil, which can, when u try to access the unix box using windows... (2 Replies)
Discussion started by: haggo
2 Replies
Login or Register to Ask a Question